linux cifs mount + unix extensions and forced UID/GID

Uri Simchoni uri_simchoni at hotmail.com
Wed Jan 14 17:28:33 GMT 2009


Hi,
 
I'm using linux vanilla kernel 2.6.28 and am mounting from my machine to a samba server. Since we don't have common uid/gid database, I'm using the uid= and gid= parameters when mounting.
I'm mounting as root, but then try to copy files as a user (the user that has the mount's uid/gid)
I've noticed an odd thing - if I mkdir on the mounted directory and right after that create a file (as in "cp -r mydir /mnt/mycifsmount/" ) then the file creation fails.
If I wait a few seconds after mkdir, the create works.
 
I think what happen is this:
- During mkdir, the created inode doesn't have the client uid/gid (since cifs_unix_info_to_inode() is called with force_uid_gid set to one)
- The dentry and its inode are kept in a cache, so subsequent access to this directory gets the inode with server uid/gid
- If I wait a few seconds, the cache entry expires and normal reading of the directory creates an inode with client uid/gid
 
I'm not sure why we want to have an inode with server uid/gid in the first place, so I'm not sure what is the correct patch.
 
Please advise.
 
Thanks,
 
Uri Simchoni.
 
_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx


More information about the samba-technical mailing list