[linux-cifs-client] mkstemp fails on cifs linux-2.6.31-rc1 / samba-3.3.6

Jeff Layton jlayton at redhat.com
Wed Jul 1 11:21:09 GMT 2009


On Wed, 2009-07-01 at 06:01 -0500, Shirish Pargaonkar wrote:
> 
> I think the problem is, why EEXIST since file does not exist.  The
> looping is I guess
> because mktemp then attempts to create another file and receives EEXIST and it
> goes on forever.
> So the basic issues is why EEXIST since mktemp is attempting a file
> which does not
> exist on the server.

The problem is that the lookup is returning a positive dentry since it
just created the file. This makes the VFS turn around and return -EEXIST
(see the second O_EXCL check in do_filp_open). So we do have to skip the
create on lookup for O_EXCL or it won't work.

I think what's needed is something like this patch. It seems to fix the
testcase for me. That said, this is not adequately regression tested and
should not be committed until it is.

On that note, I'd like to reiterate my earlier sentiment that all of
this create-on-lookup code was committed prematurely and should be
backed out until it's more fully baked.

Just my USD$.02...

-- 
Jeff Layton <jlayton at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-cifs-fix-regression-with-O_EXCL-creates-and-optimiz.patch
Type: text/x-patch
Size: 952 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux-cifs-client/attachments/20090701/344bc291/0001-cifs-fix-regression-with-O_EXCL-creates-and-optimiz.bin


More information about the linux-cifs-client mailing list