Bug 10213 - Add LinuxExtensions option to mount.cifs
Add LinuxExtensions option to mount.cifs
Status: CLOSED FIXED
Product: CifsVFS
Classification: Unclassified
Component: kernel fs
2.6
All All
: P5 enhancement
: ---
Assigned To: Steve French
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-16 12:01 UTC by Lee Hanxue
Modified: 2016-02-25 18:17 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lee Hanxue 2013-10-16 12:01:43 UTC
Samba enables Linux Extensions by default, which can be checked via /proc/fs/cifs/LinuxExtensionsEnabled

This default option will cause mounting Samba shares from Mac OS X (verified on 10.8.5 and older) as well as older CIFS shares to fail with a generic error message:

 CIFS VFS: Send error in QFSUnixInfo = -95
 CIFS VFS: cifs_read_super: get root inode failed


The workaround is to manually disable Linux extensions

$ sudo echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled


I propose having that option available via mount.cifs, in the form of

$ mount -t cifs -o linuxextensions=n .....
Comment 1 Jeff Layton 2013-10-16 12:13:43 UTC
There is already such an option. Try mounting with "-o nounix".

That said, the client will only try to negotiate unix extensions if the server sends back a NEGOTIATE response that has the CAP_UNIX bit set. If the server is setting this bit without properly supporting unix extensions then that sounds like a server-side bug.
Comment 2 Lee Hanxue 2013-10-16 13:24:01 UTC
Thanks, Jeffrey. I should really try out most of the options before reporting the bug. 


On the other hand, I did not really see the connection between "nounix" and "LinuxExtensionsEnabled". Perhaps change the latter to UNIXExtensionsEnabled for consistency?
Comment 3 Jeff Layton 2013-10-16 13:32:24 UTC
Personally, I'd rather see that procfile removed altogether since we have per-mount tunable for this. That's Steve's call however...
Comment 4 Jeff Layton 2013-10-16 13:33:57 UTC
Again too, I think you ought to do some investigation as to why your server is setting this capability bit, but then returning errors. The idea behind unix extensions is that they should "just work" without having to explicitly mess with any sort of knob. Also, what kernel is this?
Comment 5 Lee Hanxue 2013-10-21 08:03:56 UTC
The file share is hosted on OS X 10.8.5, using native Samba sharing, and I
am mounting it from Linux mint15 3.8.0-19-generic




On Wed, Oct 16, 2013 at 9:33 PM, <samba-bugs@samba.org> wrote:

> https://bugzilla.samba.org/show_bug.cgi?id=10213
>
> Jeffrey Layton <jlayton@samba.org> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>              Status|RESOLVED                    |REOPENED
>          Resolution|INVALID                     |
>
> --- Comment #4 from Jeffrey Layton <jlayton@samba.org> 2013-10-16
> 13:33:57 UTC ---
> Again too, I think you ought to do some investigation as to why your
> server is
> setting this capability bit, but then returning errors. The idea behind
> unix
> extensions is that they should "just work" without having to explicitly
> mess
> with any sort of knob. Also, what kernel is this?
>
> --
> Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You reported the bug.
>
Comment 6 Steve French 2014-10-17 22:54:23 UTC
Mac server has a bug - I added a patch to work around the problem where they advertise Unix Extensions in session setup and then fail the first, fundamental, query (UNIX_INFO_BASIC) which causes mount to fail.

We will now autodisable unix extensions when this fails to workaround the server bug.  Also note that their inode numbers are sometimes wrong so probably best to also use mount option "noserverino"

The workaround to automatically disable Unix Extensions (so "nounix" won't be required) when server incorrectly reports support (failing basic unix queries) will be in 3.18 kernel

commit b5b374eab11ef60d789e28bc36c18e2d08703212
Author: Steve French <smfrench@gmail.com>
Date:   Mon Oct 6 01:01:03 2014 -0500

    Workaround Mac server problem
    
    Mac server returns that they support CIFS Unix Extensions but
    doesn't actually support QUERY_FILE_UNIX_BASIC so mount fails.
    
    Workaround this problem by disabling use of Unix CIFS protocol
    extensions if server returns an EOPNOTSUPP error on
    QUERY_FILE_UNIX_BASIC during mount.
    
    Signed-off-by: Steve French <smfrench@gmail.com>
Comment 7 Steve French 2014-10-17 22:55:30 UTC
Note that this is probably not Samba on Mac, but Apple's own file server.

Let me know if the server is actually Samba (you can see information on the server type in /proc/fs/cifs/DebugData on the client)
Comment 8 Steve French 2014-10-17 22:58:03 UTC
Let us know if the server is actually Samba (it should be Apple's own server) - if it is Mac's server we should close this since we now work around the Mac server problem automatically.
Comment 9 Steve French 2016-02-25 18:17:23 UTC
Closing it out since no new info, and issue appears resolved.