Skip to content

Commit 7cb3a5c

Browse files
committed
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."
2 parents 1b64b2e + 0e67051 commit 7cb3a5c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

fs/cifs/inode.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,7 +2044,6 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry,
20442044
FILE_UNIX_BASIC_INFO *info_buf_target;
20452045
unsigned int xid;
20462046
int rc, tmprc;
2047-
bool new_target = d_really_is_negative(target_dentry);
20482047

20492048
if (flags & ~RENAME_NOREPLACE)
20502049
return -EINVAL;
@@ -2121,13 +2120,8 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry,
21212120
*/
21222121

21232122
unlink_target:
2124-
/*
2125-
* If the target dentry was created during the rename, try
2126-
* unlinking it if it's not negative
2127-
*/
2128-
if (new_target &&
2129-
d_really_is_positive(target_dentry) &&
2130-
(rc == -EACCES || rc == -EEXIST)) {
2123+
/* Try unlinking the target dentry if it's not negative */
2124+
if (d_really_is_positive(target_dentry) && (rc == -EACCES || rc == -EEXIST)) {
21312125
if (d_is_dir(target_dentry))
21322126
tmprc = cifs_rmdir(target_dir, target_dentry);
21332127
else

0 commit comments

Comments
 (0)