diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-06-01 16:21:01 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-06-11 21:45:36 -0400 |
commit | ed0e3ace576d297a5c7015401db1060bbf677b94 (patch) | |
tree | 0e5f0bee1be98a6c8c5c75fbf62c02c438e57df8 /fs/cifs | |
parent | 6c5de280b6683d194ee60cf22dee56eef0b09619 (diff) |
cifs: don't attempt busy-file rename unless it's in same directory
Busy-file renames don't actually work across directories, so we need
to limit this code to renames within the same dir.
This fixes the bug detailed here:
https://bugzilla.redhat.com/show_bug.cgi?id=591938
Signed-off-by: Jeff Layton <jlayton@redhat.com>
CC: Stable <stable@kernel.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/inode.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 62b324f26a56..6f0683c68952 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -1401,6 +1401,10 @@ cifs_do_rename(int xid, struct dentry *from_dentry, const char *fromPath, | |||
1401 | if (rc == 0 || rc != -ETXTBSY) | 1401 | if (rc == 0 || rc != -ETXTBSY) |
1402 | return rc; | 1402 | return rc; |
1403 | 1403 | ||
1404 | /* open-file renames don't work across directories */ | ||
1405 | if (to_dentry->d_parent != from_dentry->d_parent) | ||
1406 | return rc; | ||
1407 | |||
1404 | /* open the file to be renamed -- we need DELETE perms */ | 1408 | /* open the file to be renamed -- we need DELETE perms */ |
1405 | rc = CIFSSMBOpen(xid, pTcon, fromPath, FILE_OPEN, DELETE, | 1409 | rc = CIFSSMBOpen(xid, pTcon, fromPath, FILE_OPEN, DELETE, |
1406 | CREATE_NOT_DIR, &srcfid, &oplock, NULL, | 1410 | CREATE_NOT_DIR, &srcfid, &oplock, NULL, |