• Sasha Levin's avatar
    dm rq: fix the starting and stopping of blk-mq queues · 655fe787
    Sasha Levin authored
    [ Upstream commit 7d9595d8 ]
    
    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: default avatarMike Snitzer <snitzer@redhat.com>
    Cc: stable@vger.kernel.org # must patch dm.c on < 4.8 kernels
    Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
    655fe787
dm.c 84.6 KB