]> git.baikalelectronics.ru Git - kernel.git/commit
block: Avoid scheduling delayed work on a dead queue
authorBart Van Assche <bvanassche@acm.org>
Wed, 28 Nov 2012 12:45:56 +0000 (13:45 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 6 Dec 2012 13:32:30 +0000 (14:32 +0100)
commit445c42c301398b2052d9b8d01400edb50682471c
tree16620b55d00b289a9a343d1d2c150684fbb1661c
parenta04b3fa6294ac500c9b2cf6cc35b4920d60e7ea9
block: Avoid scheduling delayed work on a dead queue

Running a queue must continue after it has been marked dying until
it has been marked dead. So the function blk_run_queue_async() must
not schedule delayed work after blk_cleanup_queue() has marked a queue
dead. Hence add a test for that queue state in blk_run_queue_async()
and make sure that queue_unplugged() invokes that function with the
queue lock held. This avoids that the queue state can change after
it has been tested and before mod_delayed_work() is invoked. Drop
the queue dying test in queue_unplugged() since it is now
superfluous: __blk_run_queue() already tests whether or not the
queue is dead.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c