Re: [RFC PATCH] fs: touch up symlink clean up in lookup
From: Al Viro
Date: Wed Dec 17 2025 - 06:17:18 EST
On Wed, Dec 17, 2025 at 12:01:05PM +0100, Mateusz Guzik wrote:
This is obviously broken.
> +static void links_cleanup_ref(struct nameidata *nd)
> +{
> + VFS_BUG_ON(nd->flags & LOOKUP_RCU);
> +
> + if (likely(!nd->depth))
> + return;
> +
> + links_issue_delayed_calls(nd);
> +
> + path_put(&nd->path);
^^^^^^^^^^^^^^^^^^^
> + for (int i = 0; i < nd->depth; i++)
> + path_put(&nd->stack[i].link);
> + if (nd->state & ND_ROOT_GRABBED) {
> + path_put(&nd->root);
^^^^^^^^^^^^^^^^^^^
> + nd->state &= ~ND_ROOT_GRABBED;
> + }
has nothing whatsoever to with links *AND* should not be
skipped even with no symlinks in the vicinity.
NAK.