Re: [PATCH 2/3] kernfs: don't lose IN_DELETE_SELF when decoding a file handle
From: Tejun Heo
Date: Thu Sep 03 2026 - 16:29:59 EST
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: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>
Acked-by: Tejun Heo <tj@xxxxxxxxxx>
Thanks.
--
tejun