diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2025-03-14 14:17:37 -1000 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2025-03-14 14:17:37 -1000 |
commit | 85ac31fecb37f94bb667e9cda86153f03d5fd3bd (patch) | |
tree | 5c36a659796b64ceec28debe63eaedbe815ed1ef | |
parent | 2bda981bd5dddf9fc42c0cbcff6549230bbb520b (diff) | |
parent | 1a2b74d0a2a46c219b25fdb0efcf9cd7f55cfe5e (diff) |
Merge tag 'bcachefs-2025-03-14.2' of git://evilpiepirate.org/bcachefs
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()
-rw-r--r-- | fs/bcachefs/util.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c index 8e3ab4bf79a9..da2cd11b3025 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; |