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

Russ Brown pickscrape at gmail.com
Fri Jan 11 22:57:51 GMT 2008


Hello,

Hopefully someone here will be able to help me solve this because I've
been drawing complete blanks everywhere else I've tried. First in the
#f-spot IRC channel (f-spot is the application that I first made this
problem apparent to me), the f-spot mailing list, my colleagues at work
and finally #samba with no responses at all, so either this stumps
everyone or I'm just really unlucky with my timing. :)

Anyway, the problem is this. I have a Gentoo samba server running samba
3.0.28, and a Gentoo client with the net-fs/mount-cifs-3.0.25c package
installed to provide mount.cifs. Notably I suffered the same symptoms in
f-spot from an Ubuntu client machine that I never got round to debugging
at the time.

The client machine is mounting two cifs shared from the server, and for
the most part it works perfectly.

The problem can be easily demonstrated and reproduced using the
following test script:

#!/bin/bash
mkdir /mnt/cifsmount/test
touch /mnt/cifsmount/test/x

When I run this script, I get:

touch: cannot touch `/mnt/cifsmount/test/x': Permission denied

Obviously a permission problem, right? Well, not exactly. If I add in a
sleep 1 between the mkdir and the touch, the script works just fine.

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?

Many thanks,

-- 

Russ Brown


More information about the linux-cifs-client mailing list