blk-iocost: fix incorrect vtime comparison in iocg_is_idle()
authorTejun Heo <tj@kernel.org>
Tue, 10 Mar 2020 17:07:46 +0000 (13:07 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2020 06:17:52 +0000 (07:17 +0100)
commitb7e54dd751fad5163efc63fd2de9be30eb417720
tree75619b7c5a147a18a336902bad5d72bbfeffdde3
parent0c47d02ad451c052430405d48e5e7d76c9d27bfe
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>
block/blk-iocost.c