diff options
author | Tejun Heo <tj@kernel.org> | 2018-04-02 15:04:58 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-19 08:54:09 +0200 |
commit | e93df52ed0961cfddf08ee8c5230ff67366ba787 (patch) | |
tree | 03e26a0876af74e04f3efaafd5b1ed9139a19706 /block | |
parent | c1d49c389ae41c17013ae40b8a591100bba2de1b (diff) | |
download | linux-rt-e93df52ed0961cfddf08ee8c5230ff67366ba787.tar.gz |
blk-mq: Directly schedule q->timeout_work when aborting a request
commit bc6d65e6dc89c3b7ff78e4ad797117c122ffde8e upstream.
Request abortion is performed by overriding deadline to now and
scheduling timeout handling immediately. For the latter part, the
code was using mod_timer(timeout, 0) which can't guarantee that the
timer runs afterwards. Let's schedule the underlying work item
directly instead.
This fixes the hangs during probing reported by Sitsofe but it isn't
yet clear to me how the failure can happen reliably if it's just the
above described race condition.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Sitsofe Wheeler <sitsofe@gmail.com>
Reported-by: Meelis Roos <mroos@linux.ee>
Fixes: 358f70da49d7 ("blk-mq: make blk_abort_request() trigger timeout path")
Cc: stable@vger.kernel.org # v4.16
Link: http://lkml.kernel.org/r/CALjAwxh-PVYFnYFCJpGOja+m5SzZ8Sa4J7ohxdK=r8NyOF-EMA@mail.gmail.com
Link: http://lkml.kernel.org/r/alpine.LRH.2.21.1802261049140.4893@math.ut.ee
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-timeout.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-timeout.c b/block/blk-timeout.c index a05e3676d24a..f0e6e412891f 100644 --- a/block/blk-timeout.c +++ b/block/blk-timeout.c @@ -165,7 +165,7 @@ void blk_abort_request(struct request *req) * No need for fancy synchronizations. */ blk_rq_set_deadline(req, jiffies); - mod_timer(&req->q->timeout, 0); + kblockd_schedule_work(&req->q->timeout_work); } else { if (blk_mark_rq_complete(req)) return; |