From: Jeff Layton Date: Tue, 1 Jun 2010 20:21:01 +0000 (-0400) Subject: cifs: don't attempt busy-file rename unless it's in same directory X-Git-Tag: v2.6.32.17~157 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a37ac8821fce9eba8c0e3bd7d4b40c3d2cbd231f;p=karo-tx-linux.git 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 Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index a104ca30f350..303fd7f4dfe1 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,