summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNamjae Jeon <linkinjeon@kernel.org>2025-05-21 11:07:36 +0300
committerSteve French <stfrench@microsoft.com>2025-05-22 06:30:30 +0300
commit68477b5dc57108d4306c56b3842d6f80a8161f30 (patch)
tree21806e8d9f628895c2028b5bfddfd1da6ace4ca6
parent1f4bbedd4e5a69b01cde2cc21d01151ab2d0884f (diff)
downloadlinux-68477b5dc57108d4306c56b3842d6f80a8161f30.tar.xz
ksmbd: fix rename failure
I found that rename fails after cifs mount due to update of lookup_one_qstr_excl(). mv a/c b/ mv: cannot move 'a/c' to 'b/c': No such file or directory In order to rename to a new name regardless of whether the dentry is negative, we need to get the dentry through lookup_one_qstr_excl(). So It will not return error if the name doesn't exist. Fixes: 204a575e91f3 ("VFS: add common error checks to lookup_one_qstr_excl()") Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
-rw-r--r--fs/smb/server/vfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c
index 156ded9ac889..baf0d3031a44 100644
--- a/fs/smb/server/vfs.c
+++ b/fs/smb/server/vfs.c
@@ -682,7 +682,7 @@ int ksmbd_vfs_rename(struct ksmbd_work *work, const struct path *old_path,
struct ksmbd_file *parent_fp;
int new_type;
int err, lookup_flags = LOOKUP_NO_SYMLINKS;
- int target_lookup_flags = LOOKUP_RENAME_TARGET;
+ int target_lookup_flags = LOOKUP_RENAME_TARGET | LOOKUP_CREATE;
if (ksmbd_override_fsids(work))
return -ENOMEM;