diff options
author | Steve French <stfrench@microsoft.com> | 2020-02-26 01:08:54 +0100 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2020-03-23 04:49:09 +0100 |
commit | c7e9f78f7b459885ee472d661473aa87a0f24c04 (patch) | |
tree | 390322ab08b2de20c0dfb9452fc801964944aac7 /fs/cifs/inode.c | |
parent | cifs: add SMB2_open() arg to return POSIX data (diff) | |
download | linux-c7e9f78f7b459885ee472d661473aa87a0f24c04.tar.xz linux-c7e9f78f7b459885ee472d661473aa87a0f24c04.zip |
cifs: do d_move in rename
See commit 349457ccf2592c14bdf13b6706170ae2e94931b1
"Allow file systems to manually d_move() inside of ->rename()"
Lessens possibility of race conditions in rename
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index e6d66977a81d..8d01ec2dca66 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1835,6 +1835,8 @@ cifs_do_rename(const unsigned int xid, struct dentry *from_dentry, CIFSSMBClose(xid, tcon, fid.netfid); } do_rename_exit: + if (rc == 0) + d_move(from_dentry, to_dentry); cifs_put_tlink(tlink); return rc; } |