Merge tag 'bcachefs-2025-03-14.2' of git://evilpiepirate.org/bcachefs
Merge commit. Changes below are compared with the first parent: 2bda981b.
Changes
1 files changed · +2 −1
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| fs/bcachefs/util.c | modified | +2 | −1 | View file |
fs/bcachefs/util.c
View filediff --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;