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

From: Namjae Jeon

Date: Thu May 28 2026 - 20:05:55 EST


On Fri, May 29, 2026 at 2:54 AM Jori Koolstra <jkoolstra@xxxxxxxxx> 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().
>
> Signed-off-by: Jori Koolstra <jkoolstra@xxxxxxxxx>
For ksmbd part,
Reviewed-by: Namjae Jeon <linkinjeon@xxxxxxxxxx>

Thanks!