Re: [PATCH] cifs: don't attempt busy-file rename unless it's in same-directory
Jeff Layton <[email protected]> Thu, 20 May 2010 13:23:26 -0400
| Newsgroups | gmane.linux.file-systems.cifs |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 20 May 2010 12:15:37 -0500 Steve French <[email protected]> wrote: > Are we certain of this for all server types (NetApp, EMC, Samba etc.)? > This is definitely the case with windows. The open-file rename call only accepts simple filenames (no paths). > On Thu, May 20, 2010 at 12:05 PM, Jeff Layton <[email protected]> wrote: > > Busy-file renames don't actually work across directories, so we need > > to limit this code to renames within the same dir. > > > > Signed-off-by: Jeff Layton <[email protected]> > > --- > > 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 62b324f..6f0683c 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, > > 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, > > -- > > 1.6.6.1 > > > > > > > > -- > Thanks, > > Steve -- Jeff Layton <[email protected]> _______________________________________________ linux-cifs-client mailing list [email protected] https://lists.samba.org/mailman/listinfo/linux-cifs-client