[linux-cifs-client] Re: cifs patch: make cifs_rename handle -EACCES errors

Jeff Layton jlayton at redhat.com
Mon Oct 20 10:34:36 GMT 2008


On Sun, 19 Oct 2008 21:11:01 -0500
"Steve French" <smfrench at gmail.com> wrote:

> On Sun, Oct 19, 2008 at 9:00 PM, Jeff Layton <jlayton at redhat.com> wrote:
> > On Sun, 19 Oct 2008 20:01:04 -0500
> > "Steve French" <smfrench at gmail.com> wrote:
> >
> >> Looking at your cifs rename patch to add handling for servers with
> >> bugs that return EACCES instead of EEXIST, I see multiple problems
> >>
> >> - if after renaming the target to a temp name, setfiledisposition (of
> >> the delete on close flag) fails we are going to "leak" files
> >
> > I'm not seeing this. As best I can tell, we're always closing the file.
> > Could you clarify?
> 
> What I meant was that if we have a program which
> 
> creates file A
> creates file B
> renames A to B
> deletes B
> 
> if setting delete on close fails in your patch we will end up with a
> temp file at the end of the sequence which won't go away right?
> 
> 
> 

You're correct. When you said leaking files, I was thinking you
meant open filehandles. The error handling there is going to be pretty
ugly. I guess we'll need to set DELETE_ON_CLOSE before renaming the
source file, and just hold the target file open until we're done.

Let me see what I can come up with.

Thanks for the review so far...

Cheers,
-- 
Jeff Layton <jlayton at redhat.com>


More information about the linux-cifs-client mailing list