Skip to content

Commit 68477b5

Browse files
namjaejeonsmfrench
authored andcommitted
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: 204a575 ("VFS: add common error checks to lookup_one_qstr_excl()") Signed-off-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 1f4bbed commit 68477b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/smb/server/vfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ int ksmbd_vfs_rename(struct ksmbd_work *work, const struct path *old_path,
682682
struct ksmbd_file *parent_fp;
683683
int new_type;
684684
int err, lookup_flags = LOOKUP_NO_SYMLINKS;
685-
int target_lookup_flags = LOOKUP_RENAME_TARGET;
685+
int target_lookup_flags = LOOKUP_RENAME_TARGET | LOOKUP_CREATE;
686686

687687
if (ksmbd_override_fsids(work))
688688
return -ENOMEM;

0 commit comments

Comments
 (0)