blk_mq_quiesce_queue() does not wait for pending I/O to finish. Freezing a queue waits for pending I/O to finish. Hence move the comment that refers to waiting for pending I/O above the call that freezes the request queue. This patch moves this comment back to the position where it was when this comment was introduced. See also commit c125311d96b1 ("blk-wbt: don't maintain inflight counts if disabled"). Cc: Christoph Hellwig Cc: Nilay Shroff Signed-off-by: Bart Van Assche --- block/blk-sysfs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 97dc047b2b0b..b82cd859a844 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -608,6 +608,11 @@ static ssize_t queue_wb_lat_store(struct gendisk *disk, const char *page, return -EINVAL; memflags = memalloc_noio_save(); + /* + * Ensure that the queue is idled, in case the latency update + * ends up either enabling or disabling wbt completely. We can't + * have IO inflight if that happens. + */ ret = blk_mq_freeze_queue_nomemsave_timeout(q, q->rq_timeout); rqos = wbt_rq_qos(q); @@ -626,11 +631,6 @@ static ssize_t queue_wb_lat_store(struct gendisk *disk, const char *page, if (wbt_get_min_lat(q) == val) goto out; - /* - * Ensure that the queue is idled, in case the latency update - * ends up either enabling or disabling wbt completely. We can't - * have IO inflight if that happens. - */ blk_mq_quiesce_queue(q); mutex_lock(&disk->rqos_state_mutex);