projects/linux·commit 85ac31fe

Merge tag 'bcachefs-2025-03-14.2' of git://evilpiepirate.org/bcachefs

85ac31fe · Linus Torvalds <[email protected]> · 2025-03-14 14:17:37 -10:00

Pull another bcachefs hotfix from Kent Overstreet:

 - fix 32 bit build breakage

* tag 'bcachefs-2025-03-14.2' of git://evilpiepirate.org/bcachefs:
  bcachefs: fix build on 32 bit in get_random_u64_below()
Commit
85ac31fecb37f94bb667e9cda86153f03d5fd3bd
Parents
2bda981b · 1a2b74d0

Merge commit. Changes below are compared with the first parent: 2bda981b.

Changes

1 files changed · +2 −1

FileStatusAddDelContent
fs/bcachefs/util.cmodified+2−1View file

fs/bcachefs/util.c

View file
diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c
index 8e3ab4b..da2cd11 100644
--- a/fs/bcachefs/util.c
+++ b/fs/bcachefs/util.c
@@ -663,7 +663,8 @@ u64 bch2_get_random_u64_below(u64 ceil)
u64 mult = ceil * rand;
if (unlikely(mult < ceil)) {
- u64 bound = -ceil % ceil;
+ u64 bound;
+ div64_u64_rem(-ceil, ceil, &bound);
while (unlikely(mult < bound)) {
rand = get_random_u64();
mult = ceil * rand;