diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-08-17 17:08:33 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-08-17 17:11:27 -0400 |
commit | 505c326cbe091b105dbdfbe66dae4ad6ee424906 (patch) | |
tree | a7bf3a8ebac5ef648d48489eb87964e79bb2e261 /linux/closure.c | |
parent | 4d04fe42623a2f2b91a75cfa3d3503ab88e48acc (diff) |
Update bcachefs sources to a8115093df bcachefs: Fix divide by zero in rebalance_work()
Diffstat (limited to 'linux/closure.c')
-rw-r--r-- | linux/closure.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/linux/closure.c b/linux/closure.c index 0855e698..2958169c 100644 --- a/linux/closure.c +++ b/linux/closure.c @@ -17,8 +17,9 @@ static inline void closure_put_after_sub(struct closure *cl, int flags) { int r = flags & CLOSURE_REMAINING_MASK; - BUG_ON(flags & CLOSURE_GUARD_MASK); - BUG_ON(!r && (flags & ~CLOSURE_DESTRUCTOR)); + if ((flags & CLOSURE_GUARD_MASK) || + (!r && (flags & ~CLOSURE_DESTRUCTOR))) + panic("closure_put_after_sub: bogus flags %x remaining %i", flags, r); if (!r) { if (cl->fn && !(flags & CLOSURE_DESTRUCTOR)) { |