[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230521135733.1076395-1-joanbrugueram@gmail.com>
Date: Sun, 21 May 2023 13:57:33 +0000
From: Joan Bruguera Micó <joanbrugueram@...il.com>
To: zhengqi.arch@...edance.com
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Roman Gushchin <roman.gushchin@...ux.dev>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: shrinkers: fix race condition on debugfs cleanup
On 2023/5/3 13:37, Qi Zheng wrote:
> > +void shrinker_debugfs_remove(struct dentry *debugfs_entry, int debugfs_id)
> > +{
>
> It would be better to add a check:
>
> if (!debugfs_entry)
> return;
>
> > + debugfs_remove_recursive(debugfs_entry);
> > + ida_free(&shrinker_debugfs_ida, debugfs_id);
> > +}
As a practical matter, both `debugfs_remove_recursive(NULL)` and
`ida_free(_, -1);` are documented as no-ops, see:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/debugfs/inode.c?id=0dd2a6fb1e34d6dcb96806bc6b111388ad324722#n748
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fc82bbf4dede758007763867d0282353c06d1121
Sorry for the late reply (the patch already reached the mainline tree).
Powered by blists - more mailing lists