Re: [PATCH 1/2] vfs: make LAST_XXX private to fs/namei.c

From: Christian Brauner

Date: Fri May 29 2026 - 03:53:02 EST


On Thu, 28 May 2026 17:58:46 +0000, Jori Koolstra wrote:
> The only user of LAST_XXX outside of fs/namei.c is fs/smb/server/vfs.c;
> ksmbd_vfs_path_lookup() calls vfs_path_parent_lookup() and expects a
> LAST_NORM last type (or it will be ENOENT). ksmbd_vfs_rename() also calls
> vfs_path_parent_lookup() but forgets the LAST_NORM check.
>
> It does not really make sense to have vfs_path_parent_lookup() expose
> the last_type because it is only needed to ensure it is LAST_NORM. So
> let's do this check in vfs_path_parent_lookup() instead and keep the
> LAST_XXX internal to fs/namei.c. This changes the ENOENT errno in
> ksmbd_vfs_path_lookup() to EINVAL, which matches better with how this is
> handled by callers of filename_parentat().
>
> [...]

Thanks for finishing this.
This is minor whining on my part but it makes things easier if you include
--base=vfs-7.2.openat2 or whatever you're using as base and then git appends a
base-commit line at the end. Then tooling can easily identify where things need
to go. b4 does it automatically fwiw.

---

Applied to the vfs-7.2.openat2 branch of the vfs/vfs.git tree.
Patches in the vfs-7.2.openat2 branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.2.openat2

[1/2] vfs: make LAST_XXX private to fs/namei.c
https://git.kernel.org/vfs/vfs/c/f2f1dddccae5
[2/2] vfs: replace ints with enum last_type for LAST_XXX
https://git.kernel.org/vfs/vfs/c/318643721de3