On Tue, 2024-02-27 at 06:29 -0800, Ben Greear wrote: > > --- a/fs/debugfs/inode.c > > +++ b/fs/debugfs/inode.c > > @@ -751,13 +751,19 @@ static void __debugfs_file_removed(struct dentry *dentry) > > if ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT) > > return; > > > > - /* if we hit zero, just wait for all to finish */ > > - if (!refcount_dec_and_test(&fsd->active_users)) { > > - wait_for_completion(&fsd->active_users_drained); > > - return; > > - } > > + /* > > + * Now that debugfs_file_get() no longer sees a valid entry, > > + * decrement the refcount to remove the initial reference. > > + */ > > + refcount_dec(&fsd->active_users); > > [ 94.576688] ------------[ cut here ]------------ > [ 94.576699] refcount_t: decrement hit 0; leaking memory. > Ah ... right, refcount_dec() doesn't like to hit 0, it's not meant for this path. I guess we can if (refcount_dec_and_test(...)) return; while (refcount_read(...)) { ... } johannes