[linux-cifs-client] Re: CIFS and Windows 2003 Server shares
Jeff Layton
jlayton at redhat.com
Thu Jan 8 21:13:32 GMT 2009
On Thu, 08 Jan 2009 15:50:06 -0500
Rob Henderson <robh at cs.indiana.edu> wrote:
> I wanted to add a 'me too' but also provide some more details about what
> I am seeing. Since my setup involves RHEL samba servers and RHEL cifs
> clients it may provide a good environment for debugging.
>
> My problem looks to be the same as Leonardo with just one slight
> difference in that my first mount gets I/O errors rather than permission
> denied errors after the second mount steps on it. See below for a
> complete transcript demonstrating the problem.
>
> I've tested this using a diverse set of servers and clients. I've tried
> most combinations of the following mix of clients and servers and I have
> yet to find any that don't fail. It doesn't seem to matter whether I
> have /proc/fs/cifs/MultiuserMount set to 0 or 1.
>
> Servers:
>
> Red Hat EL4 running samba-3.0.28-0.el4.9 using ADS authentication
> (security=ADS)
> Red Hat EL5 running samba-3.0.28-1.el5_2.1 using ADS authentication
> (security=ADS)
> Red Hat EL5 running samba-3.0.28-1.el5_2.1 using smbpasswd
> authentication (security=user)
> Windows 2003 Server (R2)
>
> Clients (with the CIFS version as reported by /proc/fs/cifs/DebugData):
>
> Red Hat EL4 with kernel 2.6.9-78.0.8, samba version
> samba-3.0.28-0.el4.9, and CIFS version 1.50cRH
> Red Hat EL5 with kernel 2.6.18-92.1.22, samba version
> samba-3.0.28-1.el5_2.1, and CIFS version 1.50cRH
> Red Hat EL5 with kernel 2.6.18-92.1.10, samba version
> samba-3.0.28-1.el5_2.1, and CIFS version 1.50cRH
> Ubuntu 8.04.1 with kernel 2.6.24-22-rt, samba version
> 3.0.28a-1ubuntu4.7, and CIFS version 1.52
>
> We are trying to deploy a lab of RHEL workstations that get homedirs via
> samba+cifs from a RHEL file server with pam_mount managing the mounts at
> login. But, since we need to support multiple remote logins this
> problem has us dead in the water.
>
> I tried the equivalent patch to fs/cifs/connect.c that Leonardo
> suggested and so far everything seems to work! I really don't know what
> the downside of this may be but but it _does_ seem to be working. The
> RHEL5 ver is a little different than the code Leonardo was dealing with
> and here is the patch I applied:
>
> --- fs/cifs/connect.c.orig 2009-01-08 15:05:35.000000000 -0500
> +++ fs/cifs/connect.c 2009-01-08 15:11:42.000000000 -0500
> @@ -1974,7 +1974,7 @@
> return -EINVAL;
> }
>
> - if (srvTcp) {
> + if (0) {
> cFYI(1, ("Existing tcp session with server found"));
> } else { /* create socket */
> if (volume_info.port)
>
>
> Please let me know if there is any further debugging information I can
> provide. I would also be interested to know the downside of using this
> patch since it seems to work, albeit non-optimally.
>
Ok,
> ====================== transcript demonstrating failure
> ===========================
> [root at wink ~]# cat /proc/fs/cifs/MultiuserMount
> 1
> [root at wink ~]# mount -t cifs //curie.cs.indiana.edu/robh /mnt/robh -o
> user=robh
> Password:
> [root at wink ~]# df /mnt/robh
> Filesystem 1K-blocks Used Available Use% Mounted on
> //curie.cs.indiana.edu/robh
> 1692109088 537737952 1068416960 34% /mnt/robh
> [root at wink ~]# cat /proc/fs/cifs/DebugData
> Display Internal CIFS Data Structures for Debugging
> ---------------------------------------------------
> CIFS Version 1.50cRH
> Active VFS Requests: 0
> Servers:
> 1) Name: 129.79.246.140 Domain: WORKGROUP Mounts: 1 OS: Unix
> NOS: Samba 3.0.28-1.el5_2.1 Capability: 0x80f3fd
> SMB session status: 1 TCP status: 1
> Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
> MIDs:
>
> Shares:
> 1) \\curie.cs.indiana.edu\robh Uses: 1 Type: NTFS DevInfo: 0x0
> Attributes: 0x2b
> PathComponentMax: 255 Status: 1 type: 0
> [root at wink ~]# mount -t cifs //curie.cs.indiana.edu/somebogususer
> /mnt/somebogususer -o user=somebogususer
> Password:
> mount error 13 = Permission denied
> Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
>
> -> This was just a bogus username and I just hit enter at the
> password prompt so authentication failed
>
> [root at wink ~]# df /mnt/robh
> df: `/mnt/robh': Input/output error
> [root at wink ~]# ls /mnt/robh
> ls: /mnt/robh: Input/output error
> [root at wink ~]# cat /proc/fs/cifs/DebugData
> Display Internal CIFS Data Structures for Debugging
> ---------------------------------------------------
> CIFS Version 1.50cRH
> Active VFS Requests: 0
> Servers:
> 1) Name: 129.79.246.140 Domain: WORKGROUP Mounts: 1 OS: Unix
> NOS: Samba 3.0.28-1.el5_2.1 Capability: 0x80f3fd
> SMB session status: 2
> Shares:
> 1) \\curie.cs.indiana.edu\robh Uses: 1 Type: NTFS DevInfo: 0x0
> Attributes: 0x2b
> PathComponentMax: 255 Status: 1 type: 0
>
> NOTES:
>
> 1) It doesn't seem to matter what I do with the second mount command.
> In this case, I just used some nonexistant username but the behavior is
> the same if I use a real user, with or without successful authentication.
> 2) The diffs in the DebugData output show that the "SMB session
> status" changes from 1 to 2 and the "Local Users To Server" disappears
> as does the (empty) "MIDs:" section.
>
>
Rob,
Your problem sounds like a different problem from what Leonardo
described, and is probably just poor error handling in the cifs_mount
code. We've done a lot of cleanup to that code recently, so results
with more recent kernels might be better. If you have a place to test
them, please test the kernels on my people.redhat.com page and report
the results:
http://people.redhat.com/jlayton/
...they have updated CIFS code. Both the RHEL4 and RHEL5 kernels should
have the cifs_mount overhaul.
--
Jeff Layton <jlayton at redhat.com>
More information about the linux-cifs-client
mailing list