]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fs: introduce lock_rename_child() helper
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 18 Dec 2023 15:33:46 +0000 (00:33 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Dec 2023 09:41:55 +0000 (10:41 +0100)
commitb31e1ef30107b5cbd393075633ecb078e6052509
treea6f700f8567409857f2e8d1b0178d58c6f8834b0
parent380a0fe8bd606a246ab3dec5f94d70a1bf229af2
fs: introduce lock_rename_child() helper

[ Upstream commit 9bc37e04823b5280dd0f22b6680fc23fe81ca325 ]

Pass the dentry of a source file and the dentry of a destination directory
to lock parent inodes for rename. As soon as this function returns,
->d_parent of the source file dentry is stable and inodes are properly
locked for calling vfs-rename. This helper is needed for ksmbd server.
rename request of SMB protocol has to rename an opened file, no matter
which directory it's in.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/namei.c
include/linux/namei.h