dm rq: take request_queue lock while clearing QUEUE_FLAG_STOPPED
authorMike Snitzer <snitzer@redhat.com>
Thu, 1 Sep 2016 15:59:33 +0000 (11:59 -0400)
committerMike Snitzer <snitzer@redhat.com>
Wed, 14 Sep 2016 17:56:38 +0000 (13:56 -0400)
commit9dbeaeabacb26260d1621fe58f0f6fdedc8860d4
tree4a2ead82f0a872b5046b44df407b37ca8a3065a9
parent2397a15aff35b5b4eed732ce81fda5a9d15053f9
dm rq: take request_queue lock while clearing QUEUE_FLAG_STOPPED

Every call of queue_flag_clear_unlocked() after block device
initialization has finished is wrong if blk_cleanup_queue() can be
called concurrently.  Convert queue_flag_clear_unlocked() into
queue_flag_clear() and protect it by the block layer queue lock.

Also, factor out dm_mq_start_queue().

Reported-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
drivers/md/dm-rq.c