Re: [PATCH v4 10/14] VFS/ovl/smb: introduce start_renaming_dentry()
From: Namjae Jeon
Date: Wed Oct 29 2025 - 20:02:23 EST
On Thu, Oct 30, 2025 at 8:46 AM NeilBrown <neilb@xxxxxxxxxxx> wrote:
>
> From: NeilBrown <neil@xxxxxxxxxx>
>
> Several callers perform a rename on a dentry they already have, and only
> require lookup for the target name. This includes smb/server and a few
> different places in overlayfs.
>
> start_renaming_dentry() performs the required lookup and takes the
> required lock using lock_rename_child()
>
> It is used in three places in overlayfs and in ksmbd_vfs_rename().
>
> In the ksmbd case, the parent of the source is not important - the
> source must be renamed from wherever it is. So start_renaming_dentry()
> allows rd->old_parent to be NULL and only checks it if it is non-NULL.
> On success rd->old_parent will be the parent of old_dentry with an extra
> reference taken. Other start_renaming function also now take the extra
> reference and end_renaming() now drops this reference as well.
>
> ovl_lookup_temp(), ovl_parent_lock(), and ovl_parent_unlock() are
> all removed as they are no longer needed.
>
> OVL_TEMPNAME_SIZE and ovl_tempname() are now declared in overlayfs.h so
> that ovl_check_rename_whiteout() can access them.
>
> ovl_copy_up_workdir() now always cleans up on error.
>
> Reviewed-by: Amir Goldstein <amir73il@xxxxxxxxx>
> Signed-off-by: NeilBrown <neil@xxxxxxxxxx>
For ksmbd part,
Reviewed-by: Namjae Jeon <linkinjeon@xxxxxxxxxx>
Thanks!