]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Add parsing for new mount option controlling persistent handles
authorSteve French <smfrench@gmail.com>
Wed, 30 Sep 2015 02:49:28 +0000 (21:49 -0500)
committerSteve French <smfrench@gmail.com>
Sun, 1 Nov 2015 03:44:33 +0000 (22:44 -0500)
"nopersistenthandles" and "persistenthandles" mount options added.
The former will not request persistent handles on open even when
SMB3 negotiated and Continuous Availability share.  The latter
will request persistent handles (as long as server notes the
capability in protocol negotiation) even if share is not Continuous
Availability share.

Signed-off-by: Steve French <steve.french@primarydata.com>
Reviewed-by: Pavel Shilovsky <pshilovsky@samba.org>
fs/cifs/cifsglob.h
fs/cifs/connect.c

index a79e4841ca85119a95d5acbb78d92faba22adecb..221ccfacb5de96e383760b1468144256c179e154 100644 (file)
@@ -493,7 +493,9 @@ struct smb_vol {
        bool mfsymlinks:1; /* use Minshall+French Symlinks */
        bool multiuser:1;
        bool rwpidforward:1; /* pid forward for read/write operations */
-       bool nosharesock;
+       bool nosharesock:1;
+       bool persistent:1;
+       bool nopersistent:1;
        unsigned int rsize;
        unsigned int wsize;
        bool sockopt_tcp_nodelay:1;
index 011f4d86aefa813763ac49c8651d7e05a4f0fe70..a16f2f0739a0b7f7c80a3e43b95d41e8ef0991cb 100644 (file)
@@ -87,6 +87,7 @@ enum {
        Opt_sign, Opt_seal, Opt_noac,
        Opt_fsc, Opt_mfsymlinks,
        Opt_multiuser, Opt_sloppy, Opt_nosharesock,
+       Opt_persistent, Opt_nopersistent,
 
        /* Mount options which take numeric value */
        Opt_backupuid, Opt_backupgid, Opt_uid,
@@ -169,6 +170,8 @@ static const match_table_t cifs_mount_option_tokens = {
        { Opt_multiuser, "multiuser" },
        { Opt_sloppy, "sloppy" },
        { Opt_nosharesock, "nosharesock" },
+       { Opt_persistent, "persistenthandles"},
+       { Opt_nopersistent, "nopersistenthandles"},
 
        { Opt_backupuid, "backupuid=%s" },
        { Opt_backupgid, "backupgid=%s" },
@@ -1497,6 +1500,22 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
                case Opt_nosharesock:
                        vol->nosharesock = true;
                        break;
+               case Opt_nopersistent:
+                       vol->nopersistent = true;
+                       if (vol->persistent) {
+                               cifs_dbg(VFS,
+                                 "persistenthandles mount options conflict\n");
+                               goto cifs_parse_mount_err;
+                       }
+                       break;
+               case Opt_persistent:
+                       vol->persistent = true;
+                       if (vol->nopersistent) {
+                               cifs_dbg(VFS,
+                                 "persistenthandles mount options conflict\n");
+                               goto cifs_parse_mount_err;
+                       }
+                       break;
 
                /* Numeric Values */
                case Opt_backupuid: