Bug 196891 - Getting "File name too long" messages when trying to access CIFS shares
Summary: Getting "File name too long" messages when trying to access CIFS shares
Status: RESOLVED CODE_FIX
Alias: None
Product: File System
Classification: Unclassified
Component: CIFS (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: fs_cifs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-10 18:59 UTC by jed-kernel.org
Modified: 2019-02-07 10:04 UTC (History)
3 users (show)

See Also:
Kernel Version: 4.12.10
Subsystem:
Regression: No
Bisected commit-id:


Attachments
CIFS queries and responses during mount (1.12 KB, application/vnd.tcpdump.pcap)
2017-09-14 05:24 UTC, jed-kernel.org
Details
SMB2.0 fs attr info query & response (365 bytes, application/vnd.tcpdump.pcap)
2017-09-14 15:01 UTC, jed-kernel.org
Details
SMB2.1 fs attr info query & response (365 bytes, application/vnd.tcpdump.pcap)
2017-09-14 15:01 UTC, jed-kernel.org
Details
SMB3.0 fs attr info query & response (365 bytes, application/vnd.tcpdump.pcap)
2017-09-14 15:01 UTC, jed-kernel.org
Details

Description jed-kernel.org 2017-09-10 18:59:10 UTC
Ever since updating to 4.12.10, I have been getting "File name too long" messages when accessing my CIFS share:

  $ ls /nfs/users/test
  ls: cannot access '/nfs/users/test': File name too long

On my system, the CIFS share is mounted on /nfs/users. (An NFS export was transitioned to CIFS a while back, hence the oddly named mount point.)

This issue goes away if I revert to 4.12.8. Commit d3edede looks relevant.
Comment 1 Ronnie Sahlberg 2017-09-13 21:58:12 UTC
Which architecture do you see this on?

Can you attach a network trace including the initial mount, i.e. the query calls where cifs.ko will discover what the maximum length the server supports
during the mount.
Comment 2 Ronnie Sahlberg 2017-09-14 04:22:44 UTC
Please also try v4.13 as it contains the change 6e3c1529c39e92ed64ca41d53abadabbaa1d5393
Comment 3 jed-kernel.org 2017-09-14 05:24:15 UTC
Created attachment 258363 [details]
CIFS queries and responses during mount
Comment 4 jed-kernel.org 2017-09-14 05:30:35 UTC
Both server and client are x86_64. Server is samba 4.6.7.

I've attached a trace excerpt showing the queries and responses during mount. The very last message shows the server responding with max length 255.

The issue persists with 4.12.12, which includes 77ab9e7fb4312d3b377690660f757d900fa9e171, which I believe is the same as the change you mention above.
Comment 5 Ronnie Sahlberg 2017-09-14 05:46:38 UTC
That is SMB1.  Can you try with a SMB2 mount too?
Comment 6 jed-kernel.org 2017-09-14 15:01:16 UTC
Created attachment 258383 [details]
SMB2.0 fs attr info query & response
Comment 7 jed-kernel.org 2017-09-14 15:01:39 UTC
Created attachment 258385 [details]
SMB2.1 fs attr info query & response
Comment 8 jed-kernel.org 2017-09-14 15:01:57 UTC
Created attachment 258387 [details]
SMB3.0 fs attr info query & response
Comment 9 jed-kernel.org 2017-09-14 15:04:28 UTC
Same result with SMB2.0, SMB2.1, and SMB3.0. I've attached traces of the FileFsAttributeInformation queries and responses for all three protocol versions.
Comment 10 Ronnie Sahlberg 2017-09-18 23:40:09 UTC
I can not reproduce this issue using current linux/master branch.

The queries look sane in the network trace so ...


What fileserver are you using? Windows or Samba? And what version.
Can you try using the same kernel and try accessing a different share on a different file server to see if things are different.
Comment 11 jed-kernel.org 2017-10-21 14:50:56 UTC
The server is Samba 4.6.7. Users are stored in LDAP and authenticated with Kerberos. Here are the mount options I am using:

  user=machine-root,multiuser,sec=krb5,x-systemd.automount

Unfortunately, I don't have a different file server to play with, but I suspect it is the 'multiuser' option that is breaking things.

Here are the contents of /proc/fs/cifs/DebugData after the initial mount:

  Display Internal CIFS Data Structures for Debugging
  ---------------------------------------------------
  CIFS Version 2.09
  Features: dfs fscache posix spnego xattr acl
  Active VFS Requests: 0
  Servers:
  Number of credits: 17
  1) entry for SERVER_IP not fully displayed
        TCP status: 1
        Local Users To Server: 1 SecMode: 0x1 Req On Wire: 0
        Shares:
        1) \\SERVER_NAME\users Mounts: 1 DevInfo: 0x20 Attributes: 0x1006f
        PathComponentMax: 255 Status: 1 type: DISK
        Share Capabilities: None Aligned, Partition Aligned,    Share Flags: 0x0        Optimal sector size: 0x200

        MIDs:

And here it is again after I try to `ls /nfs/users/test` as a normal user:

  Display Internal CIFS Data Structures for Debugging
  ---------------------------------------------------
  CIFS Version 2.09
  Features: dfs fscache posix spnego xattr acl
  Active VFS Requests: 0
  Servers:
  Number of credits: 20
  1) entry for SERVER_IP not fully displayed
        TCP status: 1
        Local Users To Server: 2 SecMode: 0x1 Req On Wire: 0
        Shares:
        1) \\SERVER_NAME\users Mounts: 1 DevInfo: 0x0 Attributes: 0x0
        PathComponentMax: 0 Status: 1 type: 0 
        Share Capabilities: None        Share Flags: 0x0
 
        MIDs:
 
  1) entry for SERVER_IP not fully displayed
        TCP status: 1
        Local Users To Server: 2 SecMode: 0x1 Req On Wire: 0
        Shares:
        1) \\SERVER_NAME\users Mounts: 1 DevInfo: 0x20 Attributes: 0x1006f
        PathComponentMax: 255 Status: 1 type: DISK 
        Share Capabilities: None Aligned, Partition Aligned,    Share Flags: 0x0        Optimal sector size: 0x200

        MIDs:
Comment 12 jed-kernel.org 2017-12-03 19:41:45 UTC
This is fixed with 4.14.3. I'm guessing f74bc7c6679200a4a83156bb89cbf6c229fe8ec0 is what did it. Thanks!

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