diff mbox series

block: cleanup for blk_cleanup_queue()

Message ID 20190407110314.7145-1-shhuiw@foxmail.com (mailing list archive)
State New, archived
Headers show
Series block: cleanup for blk_cleanup_queue() | expand

Commit Message

Shenghui Wang April 7, 2019, 11:03 a.m. UTC
2 small cleanup:
* blk_set_queue_dying(q) has set QUEUE_FLAG_DYING. Remove the redundant
  statement 'blk_queue_flag_set(QUEUE_FLAG_DYING, q)'
* requests queued drained before DEAD marking, not DYING marking.
  Update the comment.

Signed-off-by: Shenghui Wang <shhuiw@foxmail.com>
---
 block/blk-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Bart Van Assche April 7, 2019, 2:18 p.m. UTC | #1
On 4/7/19 4:03 AM, Shenghui Wang wrote:
>   	/*
> -	 * Drain all requests queued before DYING marking. Set DEAD flag to
> +	 * Drain all requests queued before DEAD marking. Set DEAD flag to
>   	 * prevent that q->request_fn() gets invoked after draining finished.
>   	 */

No new requests can be queued between the "dying" and "dead" states. I 
wrote "dying" in that comment because I meant "dying". See also commit 
3f3299d5c026 ("block: Rename queue dead flag").

Bart.
diff mbox series

Patch

diff --git a/block/blk-core.c b/block/blk-core.c
index 4673ebe42255..177377becfab 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -334,11 +334,10 @@  void blk_cleanup_queue(struct request_queue *q)
 
 	blk_queue_flag_set(QUEUE_FLAG_NOMERGES, q);
 	blk_queue_flag_set(QUEUE_FLAG_NOXMERGES, q);
-	blk_queue_flag_set(QUEUE_FLAG_DYING, q);
 	mutex_unlock(&q->sysfs_lock);
 
 	/*
-	 * Drain all requests queued before DYING marking. Set DEAD flag to
+	 * Drain all requests queued before DEAD marking. Set DEAD flag to
 	 * prevent that q->request_fn() gets invoked after draining finished.
 	 */
 	blk_freeze_queue(q);