Whamcloud - gitweb
LU-8851 nodemap: add uid/gid only flags to control mapping
[fs/lustre-release.git] / lustre / mgs / mgs_llog.c
index ad40f2e..400a3ce 100644 (file)
@@ -3128,6 +3128,7 @@ static int mgs_write_log_quota(const struct lu_env *env, struct mgs_device *mgs,
                CDEBUG(D_MGS, "global '%s'\n", quota);
 
                if (strchr(tmp, 'u') == NULL && strchr(tmp, 'g') == NULL &&
+                   strchr(tmp, 'p') == NULL &&
                    strcmp(tmp, "none") != 0) {
                        CERROR("enable option(%s) isn't supported\n", tmp);
                        return -EINVAL;
@@ -3598,7 +3599,7 @@ static int mgs_write_log_param(const struct lu_env *env,
                                LCONSOLE_ERROR_MSG(0x144, "%s: MDC0 can not be"
                                                   " (de)activated.\n",
                                                   mti->mti_svname);
-                               GOTO(end, rc = -EINVAL);
+                               GOTO(end, rc = -EPERM);
                        }
                }
 
@@ -4935,6 +4936,19 @@ int mgs_nodemap_cmd(const struct lu_env *env, struct mgs_device *mgs,
                bool_switch = simple_strtoul(param, NULL, 10);
                rc = nodemap_set_deny_unknown(nodemap_name, bool_switch);
                break;
+       case LCFG_NODEMAP_MAP_MODE:
+               if (strcmp("both", param) == 0)
+                       rc = nodemap_set_mapping_mode(nodemap_name,
+                                                     NODEMAP_MAP_BOTH);
+               else if (strcmp("uid_only", param) == 0)
+                       rc = nodemap_set_mapping_mode(nodemap_name,
+                                                     NODEMAP_MAP_UID_ONLY);
+               else if (strcmp("gid_only", param) == 0)
+                       rc = nodemap_set_mapping_mode(nodemap_name,
+                                                     NODEMAP_MAP_GID_ONLY);
+               else
+                       rc = -EINVAL;
+               break;
        case LCFG_NODEMAP_TRUSTED:
                bool_switch = simple_strtoul(param, NULL, 10);
                rc = nodemap_set_trust_client_ids(nodemap_name, bool_switch);