On Wed, 2018-09-26 at 16:30 +0900, Damien Le Moal wrote:
> diff --git a/block/elevator.c b/block/elevator.c
> index 6a06b5d040e5..8cd81fd6339a 100644
> --- a/block/elevator.c
> +++ b/block/elevator.c
> @@ -609,7 +609,7 @@ void elv_drain_elevator(struct request_queue *q)
>  
>       while (e->type->ops.sq.elevator_dispatch_fn(q, 1))
>               ;
> -     if (q->nr_sorted && printed++ < 10) {
> +     if (q->nr_sorted && printed++ < 10 && !blk_queue_is_zoned(q)) {
>               printk(KERN_ERR "%s: forced dispatching is broken "
>                      "(nr_sorted=%u), please report this\n",
>                      q->elevator->type->elevator_name, q->nr_sorted);

It seems wrong to me to perform the blk_queue_is_zoned() check after having
incremented the "printed" variable. Shouldn't that check be performed before
incrementing the "printed" variable to avoid that "printed" gets incremented
if we know that we are not going to report the error message?

Thanks,

Bart.

Reply via email to