On Wed, Sep 02, 2026 at 09:02:52PM -0700, Shakeel Butt wrote:
> __kernfs_remove() clears i_nlink on the inode each superblock holds for
> the node, and finds those inodes with ilookup(). A lookup that has
> pinned the node but has not put its new inode in the inode hash yet is
> invisible to that pass:
>
> CPU0 CPU1
> open_by_handle_at()
> kernfs_find_and_get_node_by_id()
> pins the node, still active
> rmdir()
> marks the subtree removing
> ilookup() finds no inode
> kernfs_get_inode()
> hashes an inode with i_nlink 1
...
> Fixes: eea5d2bb34ba ("kernfs: Send IN_DELETE_SELF and IN_IGNORED")
> Cc: [email protected]
> Signed-off-by: Shakeel Butt <[email protected]>
Acked-by: Tejun Heo <[email protected]>
Thanks.
--
tejun