]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: fix race with timeouts and requeue events
authorJens Axboe <axboe@fb.com>
Thu, 24 Apr 2014 14:51:47 +0000 (08:51 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 24 Apr 2014 14:51:47 +0000 (08:51 -0600)
commite3df8fa86b5eed3dcb870f7ac2559778d04a12a9
treefbf88d2de279209467dee4d6cd9007f5daa8a678
parent0aacd7d314908215bce0e45db11c90f2b9133c56
blk-mq: fix race with timeouts and requeue events

If a requeue event races with a timeout, we can get into the
situation where we attempt to complete a request from the
timeout handler when it's not start anymore. This causes a crash.
So have the timeout handler check that REQ_ATOM_STARTED is still
set on the request - if not, we ignore the event. If this happens,
the request has now been marked as complete. As a consequence, we
need to ensure to clear REQ_ATOM_COMPLETE in blk_mq_start_request(),
as to maintain proper request state.

Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c
block/blk-mq.h
block/blk-timeout.c
block/blk.h