diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-07-25 12:53:46 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-07-25 12:53:46 -0700 |
commit | 7cb3a5c5f6478ac0c14d01e35bc49e0ba7525e21 (patch) | |
tree | 99e02ba481093ea7aafd42dfae0f1c0261f422b8 | |
parent | 1b64b2e2444c11b8dd2b657f8538c05cb699ed25 (diff) | |
parent | 0e6705182d4e1b77248a93470d6d7b3013d59b30 (diff) | |
download | linux-7cb3a5c5f6478ac0c14d01e35bc49e0ba7525e21.tar.bz2 |
Merge tag '5.8-rc6-cifs-fix' of git://git.samba.org/sfrench/cifs-2.6 into master
Pull cifs fix from Steve French:
"A fix for a recently discovered regression in rename to older servers
caused by a recent patch"
* tag '5.8-rc6-cifs-fix' of git://git.samba.org/sfrench/cifs-2.6:
Revert "cifs: Fix the target file was deleted when rename failed."
-rw-r--r-- | fs/cifs/inode.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 49c3ea8aa845..ce95801e9b66 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -2044,7 +2044,6 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry, FILE_UNIX_BASIC_INFO *info_buf_target; unsigned int xid; int rc, tmprc; - bool new_target = d_really_is_negative(target_dentry); if (flags & ~RENAME_NOREPLACE) return -EINVAL; @@ -2121,13 +2120,8 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry, */ unlink_target: - /* - * If the target dentry was created during the rename, try - * unlinking it if it's not negative - */ - if (new_target && - d_really_is_positive(target_dentry) && - (rc == -EACCES || rc == -EEXIST)) { + /* Try unlinking the target dentry if it's not negative */ + if (d_really_is_positive(target_dentry) && (rc == -EACCES || rc == -EEXIST)) { if (d_is_dir(target_dentry)) tmprc = cifs_rmdir(target_dir, target_dentry); else |