]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fs: introduce lock_rename_child() helper
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 31 Dec 2023 07:12:36 +0000 (16:12 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jan 2024 14:18:29 +0000 (15:18 +0100)
commit6e99fbb4296ad0a2f8c6674246a345045ef1eccb
treed4098e5d9a2839f2a8cc5aac3df95699ca86eddc
parent965eb8650737e626544f67545d597895f1ee252b
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: Sasha Levin <sashal@kernel.org>
fs/namei.c
include/linux/namei.h