Back to home page

OSCL-LXR

 
 

    


0001 =====
0002 Usage
0003 =====
0004 
0005 This module supports the SMB3 family of advanced network protocols (as well
0006 as older dialects, originally called "CIFS" or SMB1).
0007 
0008 The CIFS VFS module for Linux supports many advanced network filesystem
0009 features such as hierarchical DFS like namespace, hardlinks, locking and more.
0010 It was designed to comply with the SNIA CIFS Technical Reference (which
0011 supersedes the 1992 X/Open SMB Standard) as well as to perform best practice
0012 practical interoperability with Windows 2000, Windows XP, Samba and equivalent
0013 servers.  This code was developed in participation with the Protocol Freedom
0014 Information Foundation.  CIFS and now SMB3 has now become a defacto
0015 standard for interoperating between Macs and Windows and major NAS appliances.
0016 
0017 Please see
0018 MS-SMB2 (for detailed SMB2/SMB3/SMB3.1.1 protocol specification)
0019 or https://samba.org/samba/PFIF/
0020 for more details.
0021 
0022 
0023 For questions or bug reports please contact:
0024 
0025     smfrench@gmail.com
0026 
0027 See the project page at: https://wiki.samba.org/index.php/LinuxCIFS_utils
0028 
0029 Build instructions
0030 ==================
0031 
0032 For Linux:
0033 
0034 1) Download the kernel (e.g. from https://www.kernel.org)
0035    and change directory into the top of the kernel directory tree
0036    (e.g. /usr/src/linux-2.5.73)
0037 2) make menuconfig (or make xconfig)
0038 3) select cifs from within the network filesystem choices
0039 4) save and exit
0040 5) make
0041 
0042 
0043 Installation instructions
0044 =========================
0045 
0046 If you have built the CIFS vfs as module (successfully) simply
0047 type ``make modules_install`` (or if you prefer, manually copy the file to
0048 the modules directory e.g. /lib/modules/2.4.10-4GB/kernel/fs/cifs/cifs.ko).
0049 
0050 If you have built the CIFS vfs into the kernel itself, follow the instructions
0051 for your distribution on how to install a new kernel (usually you
0052 would simply type ``make install``).
0053 
0054 If you do not have the utility mount.cifs (in the Samba 4.x source tree and on
0055 the CIFS VFS web site) copy it to the same directory in which mount helpers
0056 reside (usually /sbin).  Although the helper software is not
0057 required, mount.cifs is recommended.  Most distros include a ``cifs-utils``
0058 package that includes this utility so it is recommended to install this.
0059 
0060 Note that running the Winbind pam/nss module (logon service) on all of your
0061 Linux clients is useful in mapping Uids and Gids consistently across the
0062 domain to the proper network user.  The mount.cifs mount helper can be
0063 found at cifs-utils.git on git.samba.org
0064 
0065 If cifs is built as a module, then the size and number of network buffers
0066 and maximum number of simultaneous requests to one server can be configured.
0067 Changing these from their defaults is not recommended. By executing modinfo::
0068 
0069         modinfo kernel/fs/cifs/cifs.ko
0070 
0071 on kernel/fs/cifs/cifs.ko the list of configuration changes that can be made
0072 at module initialization time (by running insmod cifs.ko) can be seen.
0073 
0074 Recommendations
0075 ===============
0076 
0077 To improve security the SMB2.1 dialect or later (usually will get SMB3) is now
0078 the new default. To use old dialects (e.g. to mount Windows XP) use "vers=1.0"
0079 on mount (or vers=2.0 for Windows Vista).  Note that the CIFS (vers=1.0) is
0080 much older and less secure than the default dialect SMB3 which includes
0081 many advanced security features such as downgrade attack detection
0082 and encrypted shares and stronger signing and authentication algorithms.
0083 There are additional mount options that may be helpful for SMB3 to get
0084 improved POSIX behavior (NB: can use vers=3.0 to force only SMB3, never 2.1):
0085 
0086    ``mfsymlinks`` and either ``cifsacl`` or ``modefromsid`` (usually with ``idsfromsid``)
0087 
0088 Allowing User Mounts
0089 ====================
0090 
0091 To permit users to mount and unmount over directories they own is possible
0092 with the cifs vfs.  A way to enable such mounting is to mark the mount.cifs
0093 utility as suid (e.g. ``chmod +s /sbin/mount.cifs``). To enable users to
0094 umount shares they mount requires
0095 
0096 1) mount.cifs version 1.4 or later
0097 2) an entry for the share in /etc/fstab indicating that a user may
0098    unmount it e.g.::
0099 
0100      //server/usersharename  /mnt/username cifs user 0 0
0101 
0102 Note that when the mount.cifs utility is run suid (allowing user mounts),
0103 in order to reduce risks, the ``nosuid`` mount flag is passed in on mount to
0104 disallow execution of an suid program mounted on the remote target.
0105 When mount is executed as root, nosuid is not passed in by default,
0106 and execution of suid programs on the remote target would be enabled
0107 by default. This can be changed, as with nfs and other filesystems,
0108 by simply specifying ``nosuid`` among the mount options. For user mounts
0109 though to be able to pass the suid flag to mount requires rebuilding
0110 mount.cifs with the following flag: CIFS_ALLOW_USR_SUID
0111 
0112 There is a corresponding manual page for cifs mounting in the Samba 3.0 and
0113 later source tree in docs/manpages/mount.cifs.8
0114 
0115 Allowing User Unmounts
0116 ======================
0117 
0118 To permit users to unmount directories that they have user mounted (see above),
0119 the utility umount.cifs may be used.  It may be invoked directly, or if
0120 umount.cifs is placed in /sbin, umount can invoke the cifs umount helper
0121 (at least for most versions of the umount utility) for umount of cifs
0122 mounts, unless umount is invoked with -i (which will avoid invoking a umount
0123 helper). As with mount.cifs, to enable user unmounts umount.cifs must be marked
0124 as suid (e.g. ``chmod +s /sbin/umount.cifs``) or equivalent (some distributions
0125 allow adding entries to a file to the /etc/permissions file to achieve the
0126 equivalent suid effect).  For this utility to succeed the target path
0127 must be a cifs mount, and the uid of the current user must match the uid
0128 of the user who mounted the resource.
0129 
0130 Also note that the customary way of allowing user mounts and unmounts is
0131 (instead of using mount.cifs and unmount.cifs as suid) to add a line
0132 to the file /etc/fstab for each //server/share you wish to mount, but
0133 this can become unwieldy when potential mount targets include many
0134 or  unpredictable UNC names.
0135 
0136 Samba Considerations
0137 ====================
0138 
0139 Most current servers support SMB2.1 and SMB3 which are more secure,
0140 but there are useful protocol extensions for the older less secure CIFS
0141 dialect, so to get the maximum benefit if mounting using the older dialect
0142 (CIFS/SMB1), we recommend using a server that supports the SNIA CIFS
0143 Unix Extensions standard (e.g. almost any  version of Samba ie version
0144 2.2.5 or later) but the CIFS vfs works fine with a wide variety of CIFS servers.
0145 Note that uid, gid and file permissions will display default values if you do
0146 not have a server that supports the Unix extensions for CIFS (such as Samba
0147 2.2.5 or later).  To enable the Unix CIFS Extensions in the Samba server, add
0148 the line::
0149 
0150         unix extensions = yes
0151 
0152 to your smb.conf file on the server.  Note that the following smb.conf settings
0153 are also useful (on the Samba server) when the majority of clients are Unix or
0154 Linux::
0155 
0156         case sensitive = yes
0157         delete readonly = yes
0158         ea support = yes
0159 
0160 Note that server ea support is required for supporting xattrs from the Linux
0161 cifs client, and that EA support is present in later versions of Samba (e.g.
0162 3.0.6 and later (also EA support works in all versions of Windows, at least to
0163 shares on NTFS filesystems).  Extended Attribute (xattr) support is an optional
0164 feature of most Linux filesystems which may require enabling via
0165 make menuconfig. Client support for extended attributes (user xattr) can be
0166 disabled on a per-mount basis by specifying ``nouser_xattr`` on mount.
0167 
0168 The CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba servers
0169 version 3.10 and later.  Setting POSIX ACLs requires enabling both XATTR and
0170 then POSIX support in the CIFS configuration options when building the cifs
0171 module.  POSIX ACL support can be disabled on a per mount basic by specifying
0172 ``noacl`` on mount.
0173 
0174 Some administrators may want to change Samba's smb.conf ``map archive`` and
0175 ``create mask`` parameters from the default.  Unless the create mask is changed
0176 newly created files can end up with an unnecessarily restrictive default mode,
0177 which may not be what you want, although if the CIFS Unix extensions are
0178 enabled on the server and client, subsequent setattr calls (e.g. chmod) can
0179 fix the mode.  Note that creating special devices (mknod) remotely
0180 may require specifying a mkdev function to Samba if you are not using
0181 Samba 3.0.6 or later.  For more information on these see the manual pages
0182 (``man smb.conf``) on the Samba server system.  Note that the cifs vfs,
0183 unlike the smbfs vfs, does not read the smb.conf on the client system
0184 (the few optional settings are passed in on mount via -o parameters instead).
0185 Note that Samba 2.2.7 or later includes a fix that allows the CIFS VFS to delete
0186 open files (required for strict POSIX compliance).  Windows Servers already
0187 supported this feature. Samba server does not allow symlinks that refer to files
0188 outside of the share, so in Samba versions prior to 3.0.6, most symlinks to
0189 files with absolute paths (ie beginning with slash) such as::
0190 
0191          ln -s /mnt/foo bar
0192 
0193 would be forbidden. Samba 3.0.6 server or later includes the ability to create
0194 such symlinks safely by converting unsafe symlinks (ie symlinks to server
0195 files that are outside of the share) to a samba specific format on the server
0196 that is ignored by local server applications and non-cifs clients and that will
0197 not be traversed by the Samba server).  This is opaque to the Linux client
0198 application using the cifs vfs. Absolute symlinks will work to Samba 3.0.5 or
0199 later, but only for remote clients using the CIFS Unix extensions, and will
0200 be invisible to Windows clients and typically will not affect local
0201 applications running on the same server as Samba.
0202 
0203 Use instructions
0204 ================
0205 
0206 Once the CIFS VFS support is built into the kernel or installed as a module
0207 (cifs.ko), you can use mount syntax like the following to access Samba or
0208 Mac or Windows servers::
0209 
0210   mount -t cifs //9.53.216.11/e$ /mnt -o username=myname,password=mypassword
0211 
0212 Before -o the option -v may be specified to make the mount.cifs
0213 mount helper display the mount steps more verbosely.
0214 After -o the following commonly used cifs vfs specific options
0215 are supported::
0216 
0217   username=<username>
0218   password=<password>
0219   domain=<domain name>
0220 
0221 Other cifs mount options are described below.  Use of TCP names (in addition to
0222 ip addresses) is available if the mount helper (mount.cifs) is installed. If
0223 you do not trust the server to which are mounted, or if you do not have
0224 cifs signing enabled (and the physical network is insecure), consider use
0225 of the standard mount options ``noexec`` and ``nosuid`` to reduce the risk of
0226 running an altered binary on your local system (downloaded from a hostile server
0227 or altered by a hostile router).
0228 
0229 Although mounting using format corresponding to the CIFS URL specification is
0230 not possible in mount.cifs yet, it is possible to use an alternate format
0231 for the server and sharename (which is somewhat similar to NFS style mount
0232 syntax) instead of the more widely used UNC format (i.e. \\server\share)::
0233 
0234   mount -t cifs tcp_name_of_server:share_name /mnt -o user=myname,pass=mypasswd
0235 
0236 When using the mount helper mount.cifs, passwords may be specified via alternate
0237 mechanisms, instead of specifying it after -o using the normal ``pass=`` syntax
0238 on the command line:
0239 1) By including it in a credential file. Specify credentials=filename as one
0240 of the mount options. Credential files contain two lines::
0241 
0242         username=someuser
0243         password=your_password
0244 
0245 2) By specifying the password in the PASSWD environment variable (similarly
0246    the user name can be taken from the USER environment variable).
0247 3) By specifying the password in a file by name via PASSWD_FILE
0248 4) By specifying the password in a file by file descriptor via PASSWD_FD
0249 
0250 If no password is provided, mount.cifs will prompt for password entry
0251 
0252 Restrictions
0253 ============
0254 
0255 Servers must support either "pure-TCP" (port 445 TCP/IP CIFS connections) or RFC
0256 1001/1002 support for "Netbios-Over-TCP/IP." This is not likely to be a
0257 problem as most servers support this.
0258 
0259 Valid filenames differ between Windows and Linux.  Windows typically restricts
0260 filenames which contain certain reserved characters (e.g.the character :
0261 which is used to delimit the beginning of a stream name by Windows), while
0262 Linux allows a slightly wider set of valid characters in filenames. Windows
0263 servers can remap such characters when an explicit mapping is specified in
0264 the Server's registry.  Samba starting with version 3.10 will allow such
0265 filenames (ie those which contain valid Linux characters, which normally
0266 would be forbidden for Windows/CIFS semantics) as long as the server is
0267 configured for Unix Extensions (and the client has not disabled
0268 /proc/fs/cifs/LinuxExtensionsEnabled). In addition the mount option
0269 ``mapposix`` can be used on CIFS (vers=1.0) to force the mapping of
0270 illegal Windows/NTFS/SMB characters to a remap range (this mount parameter
0271 is the default for SMB3). This remap (``mapposix``) range is also
0272 compatible with Mac (and "Services for Mac" on some older Windows).
0273 
0274 CIFS VFS Mount Options
0275 ======================
0276 A partial list of the supported mount options follows:
0277 
0278   username
0279                 The user name to use when trying to establish
0280                 the CIFS session.
0281   password
0282                 The user password.  If the mount helper is
0283                 installed, the user will be prompted for password
0284                 if not supplied.
0285   ip
0286                 The ip address of the target server
0287   unc
0288                 The target server Universal Network Name (export) to
0289                 mount.
0290   domain
0291                 Set the SMB/CIFS workgroup name prepended to the
0292                 username during CIFS session establishment
0293   forceuid
0294                 Set the default uid for inodes to the uid
0295                 passed in on mount. For mounts to servers
0296                 which do support the CIFS Unix extensions, such as a
0297                 properly configured Samba server, the server provides
0298                 the uid, gid and mode so this parameter should not be
0299                 specified unless the server and clients uid and gid
0300                 numbering differ.  If the server and client are in the
0301                 same domain (e.g. running winbind or nss_ldap) and
0302                 the server supports the Unix Extensions then the uid
0303                 and gid can be retrieved from the server (and uid
0304                 and gid would not have to be specified on the mount.
0305                 For servers which do not support the CIFS Unix
0306                 extensions, the default uid (and gid) returned on lookup
0307                 of existing files will be the uid (gid) of the person
0308                 who executed the mount (root, except when mount.cifs
0309                 is configured setuid for user mounts) unless the ``uid=``
0310                 (gid) mount option is specified. Also note that permission
0311                 checks (authorization checks) on accesses to a file occur
0312                 at the server, but there are cases in which an administrator
0313                 may want to restrict at the client as well.  For those
0314                 servers which do not report a uid/gid owner
0315                 (such as Windows), permissions can also be checked at the
0316                 client, and a crude form of client side permission checking
0317                 can be enabled by specifying file_mode and dir_mode on
0318                 the client.  (default)
0319   forcegid
0320                 (similar to above but for the groupid instead of uid) (default)
0321   noforceuid
0322                 Fill in file owner information (uid) by requesting it from
0323                 the server if possible. With this option, the value given in
0324                 the uid= option (on mount) will only be used if the server
0325                 can not support returning uids on inodes.
0326   noforcegid
0327                 (similar to above but for the group owner, gid, instead of uid)
0328   uid
0329                 Set the default uid for inodes, and indicate to the
0330                 cifs kernel driver which local user mounted. If the server
0331                 supports the unix extensions the default uid is
0332                 not used to fill in the owner fields of inodes (files)
0333                 unless the ``forceuid`` parameter is specified.
0334   gid
0335                 Set the default gid for inodes (similar to above).
0336   file_mode
0337                 If CIFS Unix extensions are not supported by the server
0338                 this overrides the default mode for file inodes.
0339   fsc
0340                 Enable local disk caching using FS-Cache (off by default). This
0341                 option could be useful to improve performance on a slow link,
0342                 heavily loaded server and/or network where reading from the
0343                 disk is faster than reading from the server (over the network).
0344                 This could also impact scalability positively as the
0345                 number of calls to the server are reduced. However, local
0346                 caching is not suitable for all workloads for e.g. read-once
0347                 type workloads. So, you need to consider carefully your
0348                 workload/scenario before using this option. Currently, local
0349                 disk caching is functional for CIFS files opened as read-only.
0350   dir_mode
0351                 If CIFS Unix extensions are not supported by the server
0352                 this overrides the default mode for directory inodes.
0353   port
0354                 attempt to contact the server on this tcp port, before
0355                 trying the usual ports (port 445, then 139).
0356   iocharset
0357                 Codepage used to convert local path names to and from
0358                 Unicode. Unicode is used by default for network path
0359                 names if the server supports it.  If iocharset is
0360                 not specified then the nls_default specified
0361                 during the local client kernel build will be used.
0362                 If server does not support Unicode, this parameter is
0363                 unused.
0364   rsize
0365                 default read size (usually 16K). The client currently
0366                 can not use rsize larger than CIFSMaxBufSize. CIFSMaxBufSize
0367                 defaults to 16K and may be changed (from 8K to the maximum
0368                 kmalloc size allowed by your kernel) at module install time
0369                 for cifs.ko. Setting CIFSMaxBufSize to a very large value
0370                 will cause cifs to use more memory and may reduce performance
0371                 in some cases.  To use rsize greater than 127K (the original
0372                 cifs protocol maximum) also requires that the server support
0373                 a new Unix Capability flag (for very large read) which some
0374                 newer servers (e.g. Samba 3.0.26 or later) do. rsize can be
0375                 set from a minimum of 2048 to a maximum of 130048 (127K or
0376                 CIFSMaxBufSize, whichever is smaller)
0377   wsize
0378                 default write size (default 57344)
0379                 maximum wsize currently allowed by CIFS is 57344 (fourteen
0380                 4096 byte pages)
0381   actimeo=n
0382                 attribute cache timeout in seconds (default 1 second).
0383                 After this timeout, the cifs client requests fresh attribute
0384                 information from the server. This option allows to tune the
0385                 attribute cache timeout to suit the workload needs. Shorter
0386                 timeouts mean better the cache coherency, but increased number
0387                 of calls to the server. Longer timeouts mean reduced number
0388                 of calls to the server at the expense of less stricter cache
0389                 coherency checks (i.e. incorrect attribute cache for a short
0390                 period of time).
0391   rw
0392                 mount the network share read-write (note that the
0393                 server may still consider the share read-only)
0394   ro
0395                 mount network share read-only
0396   version
0397                 used to distinguish different versions of the
0398                 mount helper utility (not typically needed)
0399   sep
0400                 if first mount option (after the -o), overrides
0401                 the comma as the separator between the mount
0402                 parms. e.g.::
0403 
0404                         -o user=myname,password=mypassword,domain=mydom
0405 
0406                 could be passed instead with period as the separator by::
0407 
0408                         -o sep=.user=myname.password=mypassword.domain=mydom
0409 
0410                 this might be useful when comma is contained within username
0411                 or password or domain. This option is less important
0412                 when the cifs mount helper cifs.mount (version 1.1 or later)
0413                 is used.
0414   nosuid
0415                 Do not allow remote executables with the suid bit
0416                 program to be executed.  This is only meaningful for mounts
0417                 to servers such as Samba which support the CIFS Unix Extensions.
0418                 If you do not trust the servers in your network (your mount
0419                 targets) it is recommended that you specify this option for
0420                 greater security.
0421   exec
0422                 Permit execution of binaries on the mount.
0423   noexec
0424                 Do not permit execution of binaries on the mount.
0425   dev
0426                 Recognize block devices on the remote mount.
0427   nodev
0428                 Do not recognize devices on the remote mount.
0429   suid
0430                 Allow remote files on this mountpoint with suid enabled to
0431                 be executed (default for mounts when executed as root,
0432                 nosuid is default for user mounts).
0433   credentials
0434                 Although ignored by the cifs kernel component, it is used by
0435                 the mount helper, mount.cifs. When mount.cifs is installed it
0436                 opens and reads the credential file specified in order
0437                 to obtain the userid and password arguments which are passed to
0438                 the cifs vfs.
0439   guest
0440                 Although ignored by the kernel component, the mount.cifs
0441                 mount helper will not prompt the user for a password
0442                 if guest is specified on the mount options.  If no
0443                 password is specified a null password will be used.
0444   perm
0445                 Client does permission checks (vfs_permission check of uid
0446                 and gid of the file against the mode and desired operation),
0447                 Note that this is in addition to the normal ACL check on the
0448                 target machine done by the server software.
0449                 Client permission checking is enabled by default.
0450   noperm
0451                 Client does not do permission checks.  This can expose
0452                 files on this mount to access by other users on the local
0453                 client system. It is typically only needed when the server
0454                 supports the CIFS Unix Extensions but the UIDs/GIDs on the
0455                 client and server system do not match closely enough to allow
0456                 access by the user doing the mount, but it may be useful with
0457                 non CIFS Unix Extension mounts for cases in which the default
0458                 mode is specified on the mount but is not to be enforced on the
0459                 client (e.g. perhaps when MultiUserMount is enabled)
0460                 Note that this does not affect the normal ACL check on the
0461                 target machine done by the server software (of the server
0462                 ACL against the user name provided at mount time).
0463   serverino
0464                 Use server's inode numbers instead of generating automatically
0465                 incrementing inode numbers on the client.  Although this will
0466                 make it easier to spot hardlinked files (as they will have
0467                 the same inode numbers) and inode numbers may be persistent,
0468                 note that the server does not guarantee that the inode numbers
0469                 are unique if multiple server side mounts are exported under a
0470                 single share (since inode numbers on the servers might not
0471                 be unique if multiple filesystems are mounted under the same
0472                 shared higher level directory).  Note that some older
0473                 (e.g. pre-Windows 2000) do not support returning UniqueIDs
0474                 or the CIFS Unix Extensions equivalent and for those
0475                 this mount option will have no effect.  Exporting cifs mounts
0476                 under nfsd requires this mount option on the cifs mount.
0477                 This is now the default if server supports the
0478                 required network operation.
0479   noserverino
0480                 Client generates inode numbers (rather than using the actual one
0481                 from the server). These inode numbers will vary after
0482                 unmount or reboot which can confuse some applications,
0483                 but not all server filesystems support unique inode
0484                 numbers.
0485   setuids
0486                 If the CIFS Unix extensions are negotiated with the server
0487                 the client will attempt to set the effective uid and gid of
0488                 the local process on newly created files, directories, and
0489                 devices (create, mkdir, mknod).  If the CIFS Unix Extensions
0490                 are not negotiated, for newly created files and directories
0491                 instead of using the default uid and gid specified on
0492                 the mount, cache the new file's uid and gid locally which means
0493                 that the uid for the file can change when the inode is
0494                 reloaded (or the user remounts the share).
0495   nosetuids
0496                 The client will not attempt to set the uid and gid on
0497                 on newly created files, directories, and devices (create,
0498                 mkdir, mknod) which will result in the server setting the
0499                 uid and gid to the default (usually the server uid of the
0500                 user who mounted the share).  Letting the server (rather than
0501                 the client) set the uid and gid is the default. If the CIFS
0502                 Unix Extensions are not negotiated then the uid and gid for
0503                 new files will appear to be the uid (gid) of the mounter or the
0504                 uid (gid) parameter specified on the mount.
0505   netbiosname
0506                 When mounting to servers via port 139, specifies the RFC1001
0507                 source name to use to represent the client netbios machine
0508                 name when doing the RFC1001 netbios session initialize.
0509   direct
0510                 Do not do inode data caching on files opened on this mount.
0511                 This precludes mmapping files on this mount. In some cases
0512                 with fast networks and little or no caching benefits on the
0513                 client (e.g. when the application is doing large sequential
0514                 reads bigger than page size without rereading the same data)
0515                 this can provide better performance than the default
0516                 behavior which caches reads (readahead) and writes
0517                 (writebehind) through the local Linux client pagecache
0518                 if oplock (caching token) is granted and held. Note that
0519                 direct allows write operations larger than page size
0520                 to be sent to the server.
0521   strictcache
0522                 Use for switching on strict cache mode. In this mode the
0523                 client read from the cache all the time it has Oplock Level II,
0524                 otherwise - read from the server. All written data are stored
0525                 in the cache, but if the client doesn't have Exclusive Oplock,
0526                 it writes the data to the server.
0527   rwpidforward
0528                 Forward pid of a process who opened a file to any read or write
0529                 operation on that file. This prevent applications like WINE
0530                 from failing on read and write if we use mandatory brlock style.
0531   acl
0532                 Allow setfacl and getfacl to manage posix ACLs if server
0533                 supports them.  (default)
0534   noacl
0535                 Do not allow setfacl and getfacl calls on this mount
0536   user_xattr
0537                 Allow getting and setting user xattrs (those attributes whose
0538                 name begins with ``user.`` or ``os2.``) as OS/2 EAs (extended
0539                 attributes) to the server.  This allows support of the
0540                 setfattr and getfattr utilities. (default)
0541   nouser_xattr
0542                 Do not allow getfattr/setfattr to get/set/list xattrs
0543   mapchars
0544                 Translate six of the seven reserved characters (not backslash)::
0545 
0546                         *?<>|:
0547 
0548                 to the remap range (above 0xF000), which also
0549                 allows the CIFS client to recognize files created with
0550                 such characters by Windows's POSIX emulation. This can
0551                 also be useful when mounting to most versions of Samba
0552                 (which also forbids creating and opening files
0553                 whose names contain any of these seven characters).
0554                 This has no effect if the server does not support
0555                 Unicode on the wire.
0556   nomapchars
0557                 Do not translate any of these seven characters (default).
0558   nocase
0559                 Request case insensitive path name matching (case
0560                 sensitive is the default if the server supports it).
0561                 (mount option ``ignorecase`` is identical to ``nocase``)
0562   posixpaths
0563                 If CIFS Unix extensions are supported, attempt to
0564                 negotiate posix path name support which allows certain
0565                 characters forbidden in typical CIFS filenames, without
0566                 requiring remapping. (default)
0567   noposixpaths
0568                 If CIFS Unix extensions are supported, do not request
0569                 posix path name support (this may cause servers to
0570                 reject creatingfile with certain reserved characters).
0571   nounix
0572                 Disable the CIFS Unix Extensions for this mount (tree
0573                 connection). This is rarely needed, but it may be useful
0574                 in order to turn off multiple settings all at once (ie
0575                 posix acls, posix locks, posix paths, symlink support
0576                 and retrieving uids/gids/mode from the server) or to
0577                 work around a bug in server which implement the Unix
0578                 Extensions.
0579   nobrl
0580                 Do not send byte range lock requests to the server.
0581                 This is necessary for certain applications that break
0582                 with cifs style mandatory byte range locks (and most
0583                 cifs servers do not yet support requesting advisory
0584                 byte range locks).
0585   forcemandatorylock
0586                 Even if the server supports posix (advisory) byte range
0587                 locking, send only mandatory lock requests.  For some
0588                 (presumably rare) applications, originally coded for
0589                 DOS/Windows, which require Windows style mandatory byte range
0590                 locking, they may be able to take advantage of this option,
0591                 forcing the cifs client to only send mandatory locks
0592                 even if the cifs server would support posix advisory locks.
0593                 ``forcemand`` is accepted as a shorter form of this mount
0594                 option.
0595   nostrictsync
0596                 If this mount option is set, when an application does an
0597                 fsync call then the cifs client does not send an SMB Flush
0598                 to the server (to force the server to write all dirty data
0599                 for this file immediately to disk), although cifs still sends
0600                 all dirty (cached) file data to the server and waits for the
0601                 server to respond to the write.  Since SMB Flush can be
0602                 very slow, and some servers may be reliable enough (to risk
0603                 delaying slightly flushing the data to disk on the server),
0604                 turning on this option may be useful to improve performance for
0605                 applications that fsync too much, at a small risk of server
0606                 crash.  If this mount option is not set, by default cifs will
0607                 send an SMB flush request (and wait for a response) on every
0608                 fsync call.
0609   nodfs
0610                 Disable DFS (global name space support) even if the
0611                 server claims to support it.  This can help work around
0612                 a problem with parsing of DFS paths with Samba server
0613                 versions 3.0.24 and 3.0.25.
0614   remount
0615                 remount the share (often used to change from ro to rw mounts
0616                 or vice versa)
0617   cifsacl
0618                 Report mode bits (e.g. on stat) based on the Windows ACL for
0619                 the file. (EXPERIMENTAL)
0620   servern
0621                 Specify the server 's netbios name (RFC1001 name) to use
0622                 when attempting to setup a session to the server.
0623                 This is needed for mounting to some older servers (such
0624                 as OS/2 or Windows 98 and Windows ME) since they do not
0625                 support a default server name.  A server name can be up
0626                 to 15 characters long and is usually uppercased.
0627   sfu
0628                 When the CIFS Unix Extensions are not negotiated, attempt to
0629                 create device files and fifos in a format compatible with
0630                 Services for Unix (SFU).  In addition retrieve bits 10-12
0631                 of the mode via the SETFILEBITS extended attribute (as
0632                 SFU does).  In the future the bottom 9 bits of the
0633                 mode also will be emulated using queries of the security
0634                 descriptor (ACL).
0635   mfsymlinks
0636                 Enable support for Minshall+French symlinks
0637                 (see http://wiki.samba.org/index.php/UNIX_Extensions#Minshall.2BFrench_symlinks)
0638                 This option is ignored when specified together with the
0639                 'sfu' option. Minshall+French symlinks are used even if
0640                 the server supports the CIFS Unix Extensions.
0641   sign
0642                 Must use packet signing (helps avoid unwanted data modification
0643                 by intermediate systems in the route).  Note that signing
0644                 does not work with lanman or plaintext authentication.
0645   seal
0646                 Must seal (encrypt) all data on this mounted share before
0647                 sending on the network.  Requires support for Unix Extensions.
0648                 Note that this differs from the sign mount option in that it
0649                 causes encryption of data sent over this mounted share but other
0650                 shares mounted to the same server are unaffected.
0651   locallease
0652                 This option is rarely needed. Fcntl F_SETLEASE is
0653                 used by some applications such as Samba and NFSv4 server to
0654                 check to see whether a file is cacheable.  CIFS has no way
0655                 to explicitly request a lease, but can check whether a file
0656                 is cacheable (oplocked).  Unfortunately, even if a file
0657                 is not oplocked, it could still be cacheable (ie cifs client
0658                 could grant fcntl leases if no other local processes are using
0659                 the file) for cases for example such as when the server does not
0660                 support oplocks and the user is sure that the only updates to
0661                 the file will be from this client. Specifying this mount option
0662                 will allow the cifs client to check for leases (only) locally
0663                 for files which are not oplocked instead of denying leases
0664                 in that case. (EXPERIMENTAL)
0665   sec
0666                 Security mode.  Allowed values are:
0667 
0668                         none
0669                                 attempt to connection as a null user (no name)
0670                         krb5
0671                                 Use Kerberos version 5 authentication
0672                         krb5i
0673                                 Use Kerberos authentication and packet signing
0674                         ntlm
0675                                 Use NTLM password hashing (default)
0676                         ntlmi
0677                                 Use NTLM password hashing with signing (if
0678                                 /proc/fs/cifs/PacketSigningEnabled on or if
0679                                 server requires signing also can be the default)
0680                         ntlmv2
0681                                 Use NTLMv2 password hashing
0682                         ntlmv2i
0683                                 Use NTLMv2 password hashing with packet signing
0684                         lanman
0685                                 (if configured in kernel config) use older
0686                                 lanman hash
0687   hard
0688                 Retry file operations if server is not responding
0689   soft
0690                 Limit retries to unresponsive servers (usually only
0691                 one retry) before returning an error.  (default)
0692 
0693 The mount.cifs mount helper also accepts a few mount options before -o
0694 including:
0695 
0696 =============== ===============================================================
0697         -S      take password from stdin (equivalent to setting the environment
0698                 variable ``PASSWD_FD=0``
0699         -V      print mount.cifs version
0700         -?      display simple usage information
0701 =============== ===============================================================
0702 
0703 With most 2.6 kernel versions of modutils, the version of the cifs kernel
0704 module can be displayed via modinfo.
0705 
0706 Misc /proc/fs/cifs Flags and Debug Info
0707 =======================================
0708 
0709 Informational pseudo-files:
0710 
0711 ======================= =======================================================
0712 DebugData               Displays information about active CIFS sessions and
0713                         shares, features enabled as well as the cifs.ko
0714                         version.
0715 Stats                   Lists summary resource usage information as well as per
0716                         share statistics.
0717 open_files              List all the open file handles on all active SMB sessions.
0718 ======================= =======================================================
0719 
0720 Configuration pseudo-files:
0721 
0722 ======================= =======================================================
0723 SecurityFlags           Flags which control security negotiation and
0724                         also packet signing. Authentication (may/must)
0725                         flags (e.g. for NTLM and/or NTLMv2) may be combined with
0726                         the signing flags.  Specifying two different password
0727                         hashing mechanisms (as "must use") on the other hand
0728                         does not make much sense. Default flags are::
0729 
0730                                 0x07007
0731 
0732                         (NTLM, NTLMv2 and packet signing allowed).  The maximum
0733                         allowable flags if you want to allow mounts to servers
0734                         using weaker password hashes is 0x37037 (lanman,
0735                         plaintext, ntlm, ntlmv2, signing allowed).  Some
0736                         SecurityFlags require the corresponding menuconfig
0737                         options to be enabled.  Enabling plaintext
0738                         authentication currently requires also enabling
0739                         lanman authentication in the security flags
0740                         because the cifs module only supports sending
0741                         laintext passwords using the older lanman dialect
0742                         form of the session setup SMB.  (e.g. for authentication
0743                         using plain text passwords, set the SecurityFlags
0744                         to 0x30030)::
0745 
0746                           may use packet signing                        0x00001
0747                           must use packet signing                       0x01001
0748                           may use NTLM (most common password hash)      0x00002
0749                           must use NTLM                                 0x02002
0750                           may use NTLMv2                                0x00004
0751                           must use NTLMv2                               0x04004
0752                           may use Kerberos security                     0x00008
0753                           must use Kerberos                             0x08008
0754                           may use lanman (weak) password hash           0x00010
0755                           must use lanman password hash                 0x10010
0756                           may use plaintext passwords                   0x00020
0757                           must use plaintext passwords                  0x20020
0758                           (reserved for future packet encryption)       0x00040
0759 
0760 cifsFYI                 If set to non-zero value, additional debug information
0761                         will be logged to the system error log.  This field
0762                         contains three flags controlling different classes of
0763                         debugging entries.  The maximum value it can be set
0764                         to is 7 which enables all debugging points (default 0).
0765                         Some debugging statements are not compiled into the
0766                         cifs kernel unless CONFIG_CIFS_DEBUG2 is enabled in the
0767                         kernel configuration. cifsFYI may be set to one or
0768                         nore of the following flags (7 sets them all)::
0769 
0770                           +-----------------------------------------------+------+
0771                           | log cifs informational messages               | 0x01 |
0772                           +-----------------------------------------------+------+
0773                           | log return codes from cifs entry points       | 0x02 |
0774                           +-----------------------------------------------+------+
0775                           | log slow responses                            | 0x04 |
0776                           | (ie which take longer than 1 second)          |      |
0777                           |                                               |      |
0778                           | CONFIG_CIFS_STATS2 must be enabled in .config |      |
0779                           +-----------------------------------------------+------+
0780 
0781 traceSMB                If set to one, debug information is logged to the
0782                         system error log with the start of smb requests
0783                         and responses (default 0)
0784 LookupCacheEnable       If set to one, inode information is kept cached
0785                         for one second improving performance of lookups
0786                         (default 1)
0787 LinuxExtensionsEnabled  If set to one then the client will attempt to
0788                         use the CIFS "UNIX" extensions which are optional
0789                         protocol enhancements that allow CIFS servers
0790                         to return accurate UID/GID information as well
0791                         as support symbolic links. If you use servers
0792                         such as Samba that support the CIFS Unix
0793                         extensions but do not want to use symbolic link
0794                         support and want to map the uid and gid fields
0795                         to values supplied at mount (rather than the
0796                         actual values, then set this to zero. (default 1)
0797 dfscache                List the content of the DFS cache.
0798                         If set to 0, the client will clear the cache.
0799 ======================= =======================================================
0800 
0801 These experimental features and tracing can be enabled by changing flags in
0802 /proc/fs/cifs (after the cifs module has been installed or built into the
0803 kernel, e.g.  insmod cifs).  To enable a feature set it to 1 e.g.  to enable
0804 tracing to the kernel message log type::
0805 
0806         echo 7 > /proc/fs/cifs/cifsFYI
0807 
0808 cifsFYI functions as a bit mask. Setting it to 1 enables additional kernel
0809 logging of various informational messages.  2 enables logging of non-zero
0810 SMB return codes while 4 enables logging of requests that take longer
0811 than one second to complete (except for byte range lock requests).
0812 Setting it to 4 requires CONFIG_CIFS_STATS2 to be set in kernel configuration
0813 (.config). Setting it to seven enables all three.  Finally, tracing
0814 the start of smb requests and responses can be enabled via::
0815 
0816         echo 1 > /proc/fs/cifs/traceSMB
0817 
0818 Per share (per client mount) statistics are available in /proc/fs/cifs/Stats.
0819 Additional information is available if CONFIG_CIFS_STATS2 is enabled in the
0820 kernel configuration (.config).  The statistics returned include counters which
0821 represent the number of attempted and failed (ie non-zero return code from the
0822 server) SMB3 (or cifs) requests grouped by request type (read, write, close etc.).
0823 Also recorded is the total bytes read and bytes written to the server for
0824 that share.  Note that due to client caching effects this can be less than the
0825 number of bytes read and written by the application running on the client.
0826 Statistics can be reset to zero by ``echo 0 > /proc/fs/cifs/Stats`` which may be
0827 useful if comparing performance of two different scenarios.
0828 
0829 Also note that ``cat /proc/fs/cifs/DebugData`` will display information about
0830 the active sessions and the shares that are mounted.
0831 
0832 Enabling Kerberos (extended security) works but requires version 1.2 or later
0833 of the helper program cifs.upcall to be present and to be configured in the
0834 /etc/request-key.conf file.  The cifs.upcall helper program is from the Samba
0835 project(https://www.samba.org). NTLM and NTLMv2 and LANMAN support do not
0836 require this helper. Note that NTLMv2 security (which does not require the
0837 cifs.upcall helper program), instead of using Kerberos, is sufficient for
0838 some use cases.
0839 
0840 DFS support allows transparent redirection to shares in an MS-DFS name space.
0841 In addition, DFS support for target shares which are specified as UNC
0842 names which begin with host names (rather than IP addresses) requires
0843 a user space helper (such as cifs.upcall) to be present in order to
0844 translate host names to ip address, and the user space helper must also
0845 be configured in the file /etc/request-key.conf.  Samba, Windows servers and
0846 many NAS appliances support DFS as a way of constructing a global name
0847 space to ease network configuration and improve reliability.
0848 
0849 To use cifs Kerberos and DFS support, the Linux keyutils package should be
0850 installed and something like the following lines should be added to the
0851 /etc/request-key.conf file::
0852 
0853   create cifs.spnego * * /usr/local/sbin/cifs.upcall %k
0854   create dns_resolver * * /usr/local/sbin/cifs.upcall %k
0855 
0856 CIFS kernel module parameters
0857 =============================
0858 These module parameters can be specified or modified either during the time of
0859 module loading or during the runtime by using the interface::
0860 
0861         /proc/module/cifs/parameters/<param>
0862 
0863 i.e.::
0864 
0865     echo "value" > /sys/module/cifs/parameters/<param>
0866 
0867 ================= ==========================================================
0868 1. enable_oplocks Enable or disable oplocks. Oplocks are enabled by default.
0869                   [Y/y/1]. To disable use any of [N/n/0].
0870 ================= ==========================================================