Whamcloud - gitweb
LU-8851 nodemap: add uid/gid only flags to control mapping
[fs/lustre-release.git] / lustre / mgs / mgs_llog.c
index 81eb22f..400a3ce 100644 (file)
@@ -3599,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);
                        }
                }
 
@@ -4936,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);