diff options
author | Jan Kara <jack@suse.cz> | 2016-06-28 03:03:59 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-06-28 10:21:44 -0400 |
commit | 9828c2c6c1048c61034a8b94e6376aeff6d2284f (patch) | |
tree | 423af910fd85e2b05619601631a6b06d4a368df8 /block | |
parent | 59a37f8baeb2c9d97f316584c90892d18bf846d4 (diff) |
block: Convert fifo_time from ulong to u64
Currently rq->fifo_time is unsigned long but CFQ stores nanosecond
timestamp in it which would overflow on 32-bit archs. Convert it to u64
to avoid the overflow. Since the rq->fifo_time is unioned with struct
call_single_data(), this does not change the size of struct request in
any way.
We have to slightly fixup block/deadline-iosched.c so that comparison
happens in the right types.
Fixes: 9a7f38c42c2b92391d9dabaf9f51df7cfe5608e4
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/deadline-iosched.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/block/deadline-iosched.c b/block/deadline-iosched.c index d0dd7882d8c7..26a9d3c8057a 100644 --- a/block/deadline-iosched.c +++ b/block/deadline-iosched.c | |||
@@ -173,7 +173,8 @@ deadline_merged_requests(struct request_queue *q, struct request *req, | |||
173 | * and move into next position (next will be deleted) in fifo | 173 | * and move into next position (next will be deleted) in fifo |
174 | */ | 174 | */ |
175 | if (!list_empty(&req->queuelist) && !list_empty(&next->queuelist)) { | 175 | if (!list_empty(&req->queuelist) && !list_empty(&next->queuelist)) { |
176 | if (time_before(next->fifo_time, req->fifo_time)) { | 176 | if (time_before((unsigned long)next->fifo_time, |
177 | (unsigned long)req->fifo_time)) { | ||
177 | list_move(&req->queuelist, &next->queuelist); | 178 | list_move(&req->queuelist, &next->queuelist); |
178 | req->fifo_time = next->fifo_time; | 179 | req->fifo_time = next->fifo_time; |
179 | } | 180 | } |
@@ -227,7 +228,7 @@ static inline int deadline_check_fifo(struct deadline_data *dd, int ddir) | |||
227 | /* | 228 | /* |
228 | * rq is expired! | 229 | * rq is expired! |
229 | */ | 230 | */ |
230 | if (time_after_eq(jiffies, rq->fifo_time)) | 231 | if (time_after_eq(jiffies, (unsigned long)rq->fifo_time)) |
231 | return 1; | 232 | return 1; |
232 | 233 | ||
233 | return 0; | 234 | return 0; |