mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-25 20:14:25 +08:00
ksmbd: clear RENAME_NOREPLACE before calling vfs_rename
[ Upstream commit 4973b04d3e
]
File overwrite case is explicitly handled, so it is not necessary to
pass RENAME_NOREPLACE to vfs_rename.
Clearing the flag fixes rename operations when the share is a ntfs-3g
mount. The latter uses an older version of fuse with no support for
flags in the ->rename op.
Cc: stable@vger.kernel.org
Signed-off-by: Marios Makassikis <mmakassikis@freebox.fr>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
8f3d0bf1d0
commit
91c6dcbc2b
@ -745,10 +745,15 @@ retry:
|
||||
goto out4;
|
||||
}
|
||||
|
||||
/*
|
||||
* explicitly handle file overwrite case, for compatibility with
|
||||
* filesystems that may not support rename flags (e.g: fuse)
|
||||
*/
|
||||
if ((flags & RENAME_NOREPLACE) && d_is_positive(new_dentry)) {
|
||||
err = -EEXIST;
|
||||
goto out4;
|
||||
}
|
||||
flags &= ~(RENAME_NOREPLACE);
|
||||
|
||||
if (old_child == trap) {
|
||||
err = -EINVAL;
|
||||
|
Loading…
Reference in New Issue
Block a user