]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: avoid to quiesce sdev->request_queue two times
authorMing Lei <ming.lei@redhat.com>
Tue, 9 Nov 2021 07:11:42 +0000 (15:11 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 9 Nov 2021 15:14:27 +0000 (08:14 -0700)
commit72c0999f1aaea4a6cbdc7b84e0c87451962e52b5
treee9d3011d2181c8e700e39ae51bb5bafdf2f0ec63
parent09ad8bbed9160d1cc25f7fdfd6967cc3b04e901a
scsi: avoid to quiesce sdev->request_queue two times

For fixing queue quiesce race between driver and block layer(elevator
switch, update nr_requests, ...), we need to support concurrent quiesce
and unquiesce, which requires the two to be balanced.

blk_mq_quiesce_queue() calls blk_mq_quiesce_queue_nowait() for updating
quiesce depth and marking the flag, then scsi_internal_device_block() calls
blk_mq_quiesce_queue_nowait() two times actually.

Fix the double quiesce and keep quiesce and unquiesce balanced.

Reported-by: Yi Zhang <yi.zhang@redhat.com>
Fixes: d777b9955b40 ("blk-mq: support concurrent queue quiesce/unquiesce")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20211109071144.181581-3-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/scsi/scsi_lib.c