]> git.baikalelectronics.ru Git - kernel.git/commit
blk-wbt: fix IO hang in wbt_wait()
authorMing Lei <ming.lei@redhat.com>
Tue, 14 Aug 2018 15:57:49 +0000 (23:57 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 14 Aug 2018 17:05:52 +0000 (11:05 -0600)
commit14990ff5732852674454ebad9e7ed408e2c019e0
tree2313844fbbbc0204fadbca168205b46cc619071e
parentea6e80c9ca4d192a418b5c5e738a538052af4556
blk-wbt: fix IO hang in wbt_wait()

On wbt invariant is that if one IO is tracked via WBT_TRACKED, rqw->inflight
should be updated for tracking this IO.

But commit 7ca0545cdfb ("block: remove external dependency on wbt_flags")
forgets to remove the early handling of !rwb_enabled(rwb) inside wbt_wait(),
then the inflight counter may not be increased in wbt_wait(), but decreased
in wbt_done() for this kind of IO, so this counter may become negative, then
wbt_wait() may wait forever.

This patch fixes the report in the following link:

https://marc.info/?l=linux-block&m=153221542021033&w=2

Fixes: 7ca0545cdfb ("block: remove external dependency on wbt_flags")
Cc: Josef Bacik <jbacik@fb.com>
Reported-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-wbt.c