summaryrefslogtreecommitdiff
path: root/fs/cifs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-06-01 16:21:01 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-02 10:26:27 -0700
commite25e90d738f0094bddc1f859237ee34d1e01a839 (patch)
treebcac9e83133e8250fa91a7da13370414751e33b0 /fs/cifs
parent56c3c8412e8aa1b0b2a515824c341fa691731440 (diff)
downloadkernel-common-e25e90d738f0094bddc1f859237ee34d1e01a839.tar.gz
kernel-common-e25e90d738f0094bddc1f859237ee34d1e01a839.tar.bz2
kernel-common-e25e90d738f0094bddc1f859237ee34d1e01a839.zip
cifs: don't attempt busy-file rename unless it's in same directory
commit ed0e3ace576d297a5c7015401db1060bbf677b94 upstream. 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> Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/inode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 7ec8555cf164..91be319e40d7 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1284,6 +1284,10 @@ cifs_do_rename(int xid, struct dentry *from_dentry, const char *fromPath,
if (rc == 0 || rc != -ETXTBSY)
return rc;
+ /* open-file renames don't work across directories */
+ if (to_dentry->d_parent != from_dentry->d_parent)
+ return rc;
+
/* open the file to be renamed -- we need DELETE perms */
rc = CIFSSMBOpen(xid, pTcon, fromPath, FILE_OPEN, DELETE,
CREATE_NOT_DIR, &srcfid, &oplock, NULL,