summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-08-12 15:25:31 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-08-14 12:28:45 -0400
commit046bd9697d887fb8345c1b575ee9720969c28351 (patch)
treedcfae5d3917fd3f5a976dd043bdfcde9c7332d65
parent2a864162c797534b702705276663d4fce8505f0c (diff)
closures: debug panic (XXX don't upstream)
hitting this assertion, arm debugging being a pita, just panic and print the value we got Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--lib/closure.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/closure.c b/lib/closure.c
index 0855e698ced1..2958169ce833 100644
--- a/lib/closure.c
+++ b/lib/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)) {