summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-06-30 05:12:09 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2024-07-10 16:53:39 +0300
commit29f1c1ae6d2fff3bf4f89d265f4a1a7c8ab78a8e (patch)
treeabbb33d3a2c71e4bdb73ad0e0d794597aaf98965 /lib
parent0435773239b5afe25801e83c8252e04299a0e306 (diff)
downloadlinux-29f1c1ae6d2fff3bf4f89d265f4a1a7c8ab78a8e.tar.xz
closures: fix closure_sync + closure debugging
originally, stack closures were only used synchronously, and with the original implementation of closure_sync() the ref never hit 0; thus, closure_put_after_sub() assumes that if the ref hits 0 it's on the debug list, in debug mode. that's no longer true with the current implementation of closure_sync, so we need a new magic so closure_debug_destroy() doesn't pop an assert. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'lib')
-rw-r--r--lib/closure.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/closure.c b/lib/closure.c
index c971216d9d77..116afae2eed9 100644
--- a/lib/closure.c
+++ b/lib/closure.c
@@ -244,6 +244,9 @@ void closure_debug_destroy(struct closure *cl)
{
unsigned long flags;
+ if (cl->magic == CLOSURE_MAGIC_STACK)
+ return;
+
BUG_ON(cl->magic != CLOSURE_MAGIC_ALIVE);
cl->magic = CLOSURE_MAGIC_DEAD;