summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Lyle <mlyle@lyle.org>2017-10-16 19:34:47 +0200
committerJens Axboe <axboe@kernel.dk>2017-10-16 21:00:10 +0200
commit9ce762e85bc95fd7aa1fb5f8cfc38ce5a228fc95 (patch)
tree2d896298abbb01ac5e998d02273aee1544ea8504
parentbcache: MAINTAINERS: set bcache to MAINTAINED (diff)
downloadlinux-9ce762e85bc95fd7aa1fb5f8cfc38ce5a228fc95.tar.xz
linux-9ce762e85bc95fd7aa1fb5f8cfc38ce5a228fc95.zip
bcache: writeback rate clamping: make 32 bit safe
Sorry this got through to linux-block, was detected by the kbuilds test robot. NSEC_PER_SEC is a long constant; 2.5 * 10^9 doesn't fit in a signed long constant. Fixes: e41166c5c44e ("bcache: writeback rate shouldn't artifically clamp") Reviewed-by: Coly Li <colyli@suse.de> Signed-off-by: Michael Lyle <mlyle@lyle.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--drivers/md/bcache/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/bcache/util.c b/drivers/md/bcache/util.c
index 4dbe37e82877..e548b8b51322 100644
--- a/drivers/md/bcache/util.c
+++ b/drivers/md/bcache/util.c
@@ -238,8 +238,8 @@ uint64_t bch_next_delay(struct bch_ratelimit *d, uint64_t done)
* don't let us sleep more than 2.5 seconds (so we can notice/respond
* if the control system tells us to speed up!).
*/
- if (time_before64(now + NSEC_PER_SEC * 5 / 2, d->next))
- d->next = now + NSEC_PER_SEC * 5 / 2;
+ if (time_before64(now + NSEC_PER_SEC * 5LLU / 2LLU, d->next))
+ d->next = now + NSEC_PER_SEC * 5LLU / 2LLU;
if (time_after64(now - NSEC_PER_SEC * 2, d->next))
d->next = now - NSEC_PER_SEC * 2;