[linux-cifs-client] Re: Error when creating file in just-created directory

Russ Brown pickscrape at gmail.com
Fri Jan 11 23:40:27 GMT 2008


Russ Brown wrote:
> Hello,
> 
> So I'm thinking that maybe it's an asynchronous operation bug, such as
> the client is sending the touch before the mkdir has finished on the
> server, so it tries to touch the file in a directory that doesn't fully
> exist yet. However, I've not been able to find an option at either the
> client or server end that solves the problem.
> 
> Actually, I just tried doing an ls -ls on the directory immediately
> after creating it, and while the access permissions are correct, the
> owner is not. So it seems that the owner is set in a separate step to
> the directory creation itself, and other operations are being permitted
> to run inbetween. I'm not sure where the problem is here... :(
> 
> Could anyone help me to correct my settings or confirm that is indeed a bug?
> 

I just discovered a lucky workaround for this that works in my case but
won't work in all and won't be acceptable in others.

When I do the ls -la immediately after the directory is created I see this:

drwxr-xr-x  2   1001 users 0 Jan 11  2008 .

Waiting an additional second it looks like this:

drwxr-xr-x  2 rbrown users 0 Jan 11  2008 .

It's looks like the problem is in matching up the uids. I'm out of my
depth here, but I do know that the uid for 'rbrown' on client and server
are different (1001 is the uid on the server).

However, since the group appears to be right immediately I've just
configured samba to force new directories to grant write access to the
group, and since I'm in the users group it works.

Now, I think this only works because the gid for users happens to be the
same on both client and server. I thought that the POSIX extended
attributes were supposed to take care of this matching up of usernames
etc, or do I have my wires crossed?

-- 

Russ.


More information about the linux-cifs-client mailing list