Commit c7e9f78f authored by Steve French's avatar Steve French

cifs: do d_move in rename

See commit 349457cc
"Allow file systems to manually d_move() inside of ->rename()"

Lessens possibility of race conditions in rename
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 69dda305
...@@ -1018,7 +1018,7 @@ struct file_system_type cifs_fs_type = { ...@@ -1018,7 +1018,7 @@ struct file_system_type cifs_fs_type = {
.name = "cifs", .name = "cifs",
.mount = cifs_do_mount, .mount = cifs_do_mount,
.kill_sb = cifs_kill_sb, .kill_sb = cifs_kill_sb,
/* .fs_flags */ .fs_flags = FS_RENAME_DOES_D_MOVE,
}; };
MODULE_ALIAS_FS("cifs"); MODULE_ALIAS_FS("cifs");
...@@ -1027,7 +1027,7 @@ static struct file_system_type smb3_fs_type = { ...@@ -1027,7 +1027,7 @@ static struct file_system_type smb3_fs_type = {
.name = "smb3", .name = "smb3",
.mount = smb3_do_mount, .mount = smb3_do_mount,
.kill_sb = cifs_kill_sb, .kill_sb = cifs_kill_sb,
/* .fs_flags */ .fs_flags = FS_RENAME_DOES_D_MOVE,
}; };
MODULE_ALIAS_FS("smb3"); MODULE_ALIAS_FS("smb3");
MODULE_ALIAS("smb3"); MODULE_ALIAS("smb3");
......
...@@ -1835,6 +1835,8 @@ cifs_do_rename(const unsigned int xid, struct dentry *from_dentry, ...@@ -1835,6 +1835,8 @@ cifs_do_rename(const unsigned int xid, struct dentry *from_dentry,
CIFSSMBClose(xid, tcon, fid.netfid); CIFSSMBClose(xid, tcon, fid.netfid);
} }
do_rename_exit: do_rename_exit:
if (rc == 0)
d_move(from_dentry, to_dentry);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment