aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-03-14 14:17:37 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2025-03-14 14:17:37 -1000
commit85ac31fecb37f94bb667e9cda86153f03d5fd3bd (patch)
tree5c36a659796b64ceec28debe63eaedbe815ed1ef
parentMerge tag 'xfs-fixes-6.14-rc7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux (diff)
parentbcachefs: fix build on 32 bit in get_random_u64_below() (diff)
downloadwireguard-linux-85ac31fecb37f94bb667e9cda86153f03d5fd3bd.tar.xz
wireguard-linux-85ac31fecb37f94bb667e9cda86153f03d5fd3bd.zip
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()
Diffstat (limited to '')
-rw-r--r--fs/bcachefs/util.c3
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;