diff options
Diffstat (limited to 'xlators')
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 2 | ||||
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 5 | ||||
| -rw-r--r-- | xlators/nfs/server/src/nfs.c | 36 | ||||
| -rw-r--r-- | xlators/nfs/server/src/nfs.h | 1 | 
4 files changed, 38 insertions, 6 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index afc761ef560..1eaed4e383c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -90,7 +90,7 @@ md5_wrapper(const unsigned char *data, size_t len, char *md5)          unsigned char scratch[MD5_DIGEST_LENGTH] = {0,};          MD5(data, len, scratch);          for (; i < MD5_DIGEST_LENGTH; i++) -                snprintf(md5 + i * 2, lim-i*2, "%02x", scratch[i]);  +                snprintf(md5 + i * 2, lim-i*2, "%02x", scratch[i]);  }  int32_t diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 3cf5b5f1331..c91a38a4637 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -210,6 +210,7 @@ static struct volopt_map_entry glusterd_volopt_map[] = {          {"nfs.volume-access",                    "nfs/server",                "!nfs3.*.volume-access", NULL, DOC, 0},          {"nfs.export-dir",                       "nfs/server",                "!nfs3.*.export-dir", NULL, DOC, 0},          {"nfs.disable",                          "nfs/server",                "!nfs-disable", NULL, DOC, 0}, +        {"nfs.nlm",                              "nfs/server",                "nfs.nlm", NULL, GLOBAL_DOC, 0},          {VKEY_FEATURES_QUOTA,                    "features/marker",           "quota", "off", NO_DOC, OPT_FLAG_FORCE},          {VKEY_FEATURES_LIMIT_USAGE,              "features/quota",            "limit-set", NULL, NO_DOC, 0}, @@ -2868,6 +2869,10 @@ build_nfs_graph (volgen_graph_t *graph, dict_t *mod_dict)          if (ret)                  goto out; +        ret = xlator_set_option (nfsxl, "nfs.nlm", "on"); +        if (ret) +                goto out; +          list_for_each_entry (voliter, &priv->volumes, vol_list) {                  if (voliter->status != GLUSTERD_STATUS_STARTED)                          continue; diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index f2c690994d2..d4feded24e2 100644 --- a/xlators/nfs/server/src/nfs.c +++ b/xlators/nfs/server/src/nfs.c @@ -173,11 +173,15 @@ nfs_add_all_initiators (struct nfs_state *nfs)                  goto ret;          } -        ret = nfs_add_initer (&nfs->versions, nlm4svc_init); -        if (ret == -1) { -                gf_log (GF_NFS, GF_LOG_ERROR, "Failed to add protocol" -                        " initializer"); -                goto ret; +        if (nfs->enable_nlm == _gf_true) { +                ret = nfs_add_initer (&nfs->versions, nlm4svc_init); +                if (ret == -1) { +                        gf_log (GF_NFS, GF_LOG_ERROR, "Failed to add protocol" +                                " initializer"); +                        goto ret; +                } +        } else { +                gf_log (GF_NFS, GF_LOG_INFO, "NLM is manually disabled");          }          ret = 0; @@ -570,6 +574,20 @@ nfs_init_state (xlator_t *this)                          nfs->dynamicvolumes = GF_NFS_DVM_ON;          } +        nfs->enable_nlm = _gf_true; +        if (!dict_get_str (this->options, "nfs.nlm", &optstr)) { + +                ret = gf_string2boolean (optstr, &boolt); +                if (ret < 0) { +                        gf_log (GF_NFS, GF_LOG_ERROR, "Failed to parse" +                                " bool string"); +                        goto free_foppool; +                } + +                if (boolt == _gf_false) +                        nfs->enable_nlm = _gf_false; +        } +          nfs->enable_ino32 = 0;          if (dict_get (this->options, "nfs.enable-ino32")) {                  ret = dict_get_str (this->options, "nfs.enable-ino32", @@ -1145,6 +1163,14 @@ struct volume_options options[] = {            .description = "This option is used to start or stop NFS server"                           "for individual volume."          }, + +        { .key  = {"nfs.nlm"}, +          .type = GF_OPTION_TYPE_BOOL, +          .description = "This option, if set to 'off', disables NLM server " +                         "by not registering the service with the portmapper." +                         " Set it to 'on' to re-enable it. Default value: 'on'" +        }, +          { .key  = {NULL} },  }; diff --git a/xlators/nfs/server/src/nfs.h b/xlators/nfs/server/src/nfs.h index 706cba86f3e..0c9721244c6 100644 --- a/xlators/nfs/server/src/nfs.h +++ b/xlators/nfs/server/src/nfs.h @@ -85,6 +85,7 @@ struct nfs_state {          int                     enable_ino32;          unsigned int            override_portnum;          int                     allow_insecure; +        int                     enable_nlm;          struct rpc_clnt         *rpc_clnt;  };  | 
