]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dm rq: fix the starting and stopping of blk-mq queues
authorSasha Levin <alexander.levin@verizon.com>
Sat, 13 Aug 2016 11:45:12 +0000 (07:45 -0400)
committerDhaval Giani <dhaval.giani@oracle.com>
Fri, 20 Jan 2017 22:22:09 +0000 (17:22 -0500)
commitcf96a6c88c48687a85c81fbbb37e68db678cae81
tree7b07ef3e699e24949bc0bf0e12880019bb200c97
parent4feda1499ef26d451ccc952822ac2afd80e1887a
dm rq: fix the starting and stopping of blk-mq queues

Orabug: 25308141

[ Upstream commit 7d9595d848cdff5c7939f68eec39e0c5d36a1d67 ]

Improve dm_stop_queue() to cancel any requeue_work.  Also, have
dm_start_queue() and dm_stop_queue() clear/set the QUEUE_FLAG_STOPPED
for the blk-mq request_queue.

On suspend dm_stop_queue() handles stopping the blk-mq request_queue
BUT: even though the hw_queues are marked BLK_MQ_S_STOPPED at that point
there is still a race that is allowing block/blk-mq.c to call ->queue_rq
against a hctx that it really shouldn't.  Add a check to
dm_mq_queue_rq() that guards against this rarity (albeit _not_
race-free).

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org # must patch dm.c on < 4.8 kernels
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
(cherry picked from commit 655fe78746d0b9141fe763535fc16d6652665c13)
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/md/dm.c