1 From ed0e3ace576d297a5c7015401db1060bbf677b94 Mon Sep 17 00:00:00 2001
2 From: Jeff Layton <jlayton@redhat.com>
3 Date: Tue, 1 Jun 2010 16:21:01 -0400
4 Subject: cifs: don't attempt busy-file rename unless it's in same directory
6 From: Jeff Layton <jlayton@redhat.com>
8 commit ed0e3ace576d297a5c7015401db1060bbf677b94 upstream.
10 Busy-file renames don't actually work across directories, so we need
11 to limit this code to renames within the same dir.
13 This fixes the bug detailed here:
15 https://bugzilla.redhat.com/show_bug.cgi?id=591938
17 Signed-off-by: Jeff Layton <jlayton@redhat.com>
18 Signed-off-by: Steve French <sfrench@us.ibm.com>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
22 fs/cifs/inode.c | 4 ++++
23 1 file changed, 4 insertions(+)
27 @@ -1284,6 +1284,10 @@ cifs_do_rename(int xid, struct dentry *f
28 if (rc == 0 || rc != -ETXTBSY)
31 + /* open-file renames don't work across directories */
32 + if (to_dentry->d_parent != from_dentry->d_parent)
35 /* open the file to be renamed -- we need DELETE perms */
36 rc = CIFSSMBOpen(xid, pTcon, fromPath, FILE_OPEN, DELETE,
37 CREATE_NOT_DIR, &srcfid, &oplock, NULL,