Bug 12246 - File permission problem only with linux client
Summary: File permission problem only with linux client
Status: RESOLVED CODE_FIX
Alias: None
Product: File System
Classification: Unclassified
Component: CIFS (show other bugs)
Hardware: All Linux
: P1 high
Assignee: Steve French
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-18 05:20 UTC by Pol Hallen
Modified: 2009-03-02 11:50 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.27.7
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
Adds nodfs option to cifs (1.43 KB, text/x-diff)
2008-12-20 05:20 UTC, Michael
Details

Description Pol Hallen 2008-12-18 05:20:03 UTC
Latest working kernel version: 2.6.22
Distribution: debian stable/testing
Hardware Environment: several p4,dual core, quad core, vmware

Problem Description: Impossible write on file when it is mouted by cifs fs - I can create a file, delete the file, rename the file but I can't write or append on it.

Steps to reproduce:

mount -t cifs //ip_server/test0 /local/test0 -o "username=xxx,password=xxx"
or using smbmount, mount.cifs and other

from client:
touch /local/test0/filetest
touch: setting times of `local/test0/filetest': Invalid argument

I also tried from a client (before I umounted all share)
echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled
mount -t cifs //ip_server/test0 /local/test0
echo 1 > /proc/fs/cifs/LinuxExtensionsEnabled
(read in ML of samba)

I tried on the samba server use: create mask = 0777, directory mask = 0777, unix extensions = yes (or later) no, acl support = no (or) yes

permission of share on the server are: rwxrwxrwx

But: with konqueror using smb://ip_server/test0 everything is ok

With apple client, windows client everything is ok.

I suppose that the problem is in cifs module, because if I use smbfs to mount remote share everything is ok.

Please tell me if you need other info.

Thanks
Pol
Comment 1 Pol Hallen 2008-12-18 10:08:11 UTC
With last kernel (2.6.27.9) same problem.
Pol
Comment 2 Michael 2008-12-20 05:19:16 UTC
Hmm, I had the same problem some time ago. Posted that on the cifs developer list. In my case it is a bug in the samba server, which does not work correcly with dls. It only concerns the version in etch. Sid already has a fixed samba server.

The workaround is to disable dls in the client. There is a patch in the developer list flying around.

There is no problem with windows clients as they apparently don't use dls.

I will attach the patch. Maybe it helps.

Cheers,

Michael

P.S.: The patch will be in the 2.6.28 kernel I was told.
Comment 3 Michael 2008-12-20 05:20:42 UTC
Created attachment 19400 [details]
Adds nodfs option to cifs
Comment 4 Michael 2008-12-20 05:22:26 UTC
Sorry, please replace "dls" with "dfs" in my posting. (I guess I need an xmodhack here :-) )

To use the patch, you need to recompile the kernel with the patch. Furthermore, to show any effect, you need to add the option "nodfs" to your mount options.
Comment 5 Pol Hallen 2008-12-20 08:07:08 UTC
Hi and thanks for the reply, so I should recompile more than 30 (different) linux client to resolve the problem?!

Is there another way to resolve the problem?

Thanks
Pol
Comment 6 Pol Hallen 2008-12-21 03:28:53 UTC
Is there a patch to 2.6.27.10? I prefer use stable kernel.
Thanks.

Pol
Comment 7 Shirish Pargaonkar 2009-01-22 13:19:31 UTC
Can you run a wireshark trace either on the server or client when you
issue the command that fails and attach that trace here alongwith the
command you used?  I assume the server is a samba server and the exported
share is part of a local filesytem on the server!
Comment 8 Steve French 2009-02-17 13:51:42 UTC
If you believe that this is related to the Samba server DFS path processing bug (for which the relatively new "nodfs" client mount option provides a workaround, by avoiding requesting dfs path support during smb/cifs negotiation), then it can be disabled on the server.

The server DFS path processing problem occurred with Samba server versions approximately version 3.0.26, and it was a problem on version 2.6.26 through 2.6.27 Linux kernel cifs client.
Comment 9 Steve French 2009-02-17 14:26:53 UTC
Although I doubt that this is the cause of your bug, to turn dfs off on the server can be done by setting

"host msdfds = no" in /etc/samba/smb.conf

Otherwise to make much progress would require a debug log:
1) dmesg -c   (to clear the log)
2) echo 7 > /proc/fs/cifs/cifsFYI   (to enable cifs logging)
3) dmesg > debug-data-to-send-in    (to save the debug information
4) echo 0 > /proc/fs/cifs/cifsFYI   (to turn off logging)

and/or a network trace

http://wiki.samba.org/index.php/Capture_Packets

This will allow us to narrow the problem down.
Comment 10 Shirish Pargaonkar 2009-02-18 02:29:19 UTC
cifstest6:~ # uname -r
2.6.27.8-1-default

cifstest6:~ # mount -t cifs //cifstest8/smb8 /mnt/smb_a -o user=root,pass=password

cifstest6:~ # ls -l /mnt/smb_a
total 4
-rw-r--r-- 1 root root 16 Feb 18 04:11 f1

cifstest6:~ # vi /mnt/smb_a/f2
cifstest6:~ # touch /mnt/smb_a/f2

cifstest6:~ # touch /mnt/smb_a/f3

Permissons on the share directory on the samba server are 777.


If I mount that share as a different user (i.e. -o user=xyz,pass-uvw), I do not see
any problem touch'ing existing files as well as new files as long as permissions
are right.  Certainly no 'setting times, invalid argument' error.

If at all, this sounds more like a server issue than a client issue.
Comment 11 Steve French 2009-03-02 11:15:10 UTC
Has been fixed (the Samba server problem mentioned above was also fixed).
Comment 12 Pol Hallen 2009-03-02 11:24:35 UTC
Which version of samba server includes this fix?
Comment 13 Steve French 2009-03-02 11:50:37 UTC
I think the Samba server problem with malformed DFS paths was fixed in Samba 3.0.26 (server) but could also be worked around (with turning off DFS support on the server smb.conf).

Note You need to log in before you can comment on or make changes to this bug.