Skip to contentSkip to conversation

bcache: writeback rate clamping: make 32 bit safe

PATCH Applied Michael Lyle 3 participants 5 messages Oct 16, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/md/bcache/util.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/md/bcache/util.c +2 -2
index 4dbe37e82877..e548b8b51322 100644
@@ -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;
Signature · 1 line
2.11.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Michael Lyle

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.

I forgot i386 config... sorry too...

Thanks to Michael for the fix.

Coly Li

Quoted 19 lines
---
 drivers/md/bcache/util.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/md/bcache/util.c +2 -2
index 4dbe37e82877..e548b8b51322 100644
@@ -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;
maintainer Applied
#2 lore raw
In reply to Michael Lyle
Quoted 3 lines · Michael Lyle

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.

Applied, but you should remember to add Fixes lines when a patch explicitly fixes a problem introduced by a previous patch. Ala:

Fixes e41166c5c44e ("bcache: writeback rate shouldn't artifically clamp")

so that backports have an easier time finding dependent fixes.

Signature · 1 line
Jens Axboe
#3 lore raw

Jens--

Thanks for your patience.

Quoted 11 lines · Jens Axboe
Quoted 3 lines · Michael Lyle

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.

Applied, but you should remember to add Fixes lines when a patch explicitly fixes a problem introduced by a previous patch. Ala:

Fixes e41166c5c44e ("bcache: writeback rate shouldn't artifically clamp")

so that backports have an easier time finding dependent fixes.

Sorry about that too. I considered the Fixes: tag but didn't know if the hashes would "hold true" into mainline. Now I see Linus merges your tree so the hash should be durable.

Quoted 4 lines

--
Jens Axboe

Mike

maintainer
#4 lore raw
Quoted 13 lines · Michael Lyle

Jens--

Thanks for your patience.

Quoted 8 lines · Jens Axboe
Quoted 3 lines · Michael Lyle

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.

Applied, but you should remember to add Fixes lines when a patch explicitly fixes a problem introduced by a previous patch. Ala:

Quoted 7 lines
Quoted 3 lines
Fixes e41166c5c44e ("bcache: writeback rate shouldn't artifically clamp")

so that backports have an easier time finding dependent fixes.

Sorry about that too. I considered the Fixes: tag but didn't know if the hashes would "hold true" into mainline. Now I see Linus merges your tree so the hash should be durable.

They are durable once applied, so yeah.

Signature · 1 line
Jens Axboe