]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerJens Axboe <axboe@kernel.dk>
Tue, 10 Mar 2020 17:37:00 +0000 (11:37 -0600)
commitf6d4dee16acf88b25d621ef2022ace7055035a0a
tree91180ac53f515b5e6e293f2828fef6bbb812b1a8
parent315d81eca8574758e136f4f78f22e79622d5ce8a
blk-iocost: fix incorrect vtime comparison in iocg_is_idle()

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: 804998b28924 ("blkcg: implement blk-iocost")
Cc: stable@vger.kernel.org # v5.4+
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-iocost.c