Skip to content

Commit

Permalink
cfq-iosched: Convert slice_resid from u64 to s64
Browse files Browse the repository at this point in the history
slice_resid can be both positive and negative. Commit 9a7f38c
(cfq-iosched: Convert from jiffies to nanoseconds) converted it from
long to u64. Although this did not introduce any functional regression
(the operations just overflow and the result was fine), it is certainly
wrong and could cause issues in future. So convert the type to more
appropriate s64.

Fixes: 9a7f38c
Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
jankara authored and axboe committed Jun 28, 2016
1 parent 9828c2c commit 93fdf14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ struct cfq_queue {
/* time when first request from queue completed and slice started. */
u64 slice_start;
u64 slice_end;
u64 slice_resid;
s64 slice_resid;

/* pending priority requests */
int prio_pending;
Expand Down Expand Up @@ -2689,7 +2689,7 @@ __cfq_slice_expired(struct cfq_data *cfqd, struct cfq_queue *cfqq,
cfqq->slice_resid = cfq_scaled_cfqq_slice(cfqd, cfqq);
else
cfqq->slice_resid = cfqq->slice_end - ktime_get_ns();
cfq_log_cfqq(cfqd, cfqq, "resid=%llu", cfqq->slice_resid);
cfq_log_cfqq(cfqd, cfqq, "resid=%lld", cfqq->slice_resid);
}

cfq_group_served(cfqd, cfqq->cfqg, cfqq);
Expand Down

0 comments on commit 93fdf14

Please sign in to comment.