diff options
author | Tejun Heo <tj@kernel.org> | 2020-03-10 13:07:46 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-03-18 07:17:52 +0100 |
commit | b7e54dd751fad5163efc63fd2de9be30eb417720 (patch) | |
tree | 75619b7c5a147a18a336902bad5d72bbfeffdde3 /block | |
parent | 0c47d02ad451c052430405d48e5e7d76c9d27bfe (diff) |
blk-iocost: fix incorrect vtime comparison in iocg_is_idle()
commit dcd6589b11d3b1e71f516a87a7b9646ed356b4c0 upstream.
vtimes may wrap and time_before/after64() should be used to determine
whether a given vtime is before or after another. iocg_is_idle() was
incorrectly using plain "<" comparison do determine whether done_vtime
is before vtime. Here, the only thing we're interested in is whether
done_vtime matches vtime which indicates that there's nothing in
flight. Let's test for inequality instead.
Signed-off-by: Tejun Heo <tj@kernel.org>
Fixes: 7caa47151ab2 ("blkcg: implement blk-iocost")
Cc: stable@vger.kernel.org # v5.4+
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-iocost.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 27ca68621137..9a599cc28c29 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -1318,7 +1318,7 @@ static bool iocg_is_idle(struct ioc_gq *iocg) return false; /* is something in flight? */ - if (atomic64_read(&iocg->done_vtime) < atomic64_read(&iocg->vtime)) + if (atomic64_read(&iocg->done_vtime) != atomic64_read(&iocg->vtime)) return false; return true; |