Skip to content

Commit dcd6589

Browse files
htejunaxboe
authored andcommitted
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 <[email protected]> Fixes: 7caa471 ("blkcg: implement blk-iocost") Cc: [email protected] # v5.4+ Signed-off-by: Jens Axboe <[email protected]>
1 parent 14afc59 commit dcd6589

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/blk-iocost.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ static bool iocg_is_idle(struct ioc_gq *iocg)
13181318
return false;
13191319

13201320
/* is something in flight? */
1321-
if (atomic64_read(&iocg->done_vtime) < atomic64_read(&iocg->vtime))
1321+
if (atomic64_read(&iocg->done_vtime) != atomic64_read(&iocg->vtime))
13221322
return false;
13231323

13241324
return true;

0 commit comments

Comments
 (0)