Skip to content

Commit 85ac31f

Browse files
committed
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()
2 parents 2bda981 + 1a2b74d commit 85ac31f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/bcachefs/util.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,8 @@ u64 bch2_get_random_u64_below(u64 ceil)
663663
u64 mult = ceil * rand;
664664

665665
if (unlikely(mult < ceil)) {
666-
u64 bound = -ceil % ceil;
666+
u64 bound;
667+
div64_u64_rem(-ceil, ceil, &bound);
667668
while (unlikely(mult < bound)) {
668669
rand = get_random_u64();
669670
mult = ceil * rand;

0 commit comments

Comments
 (0)