summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/shmem.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 9435f298dd75..177c7a7d2bb3 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1125,20 +1125,26 @@ static int shmem_parse_mpol(char *value, unsigned short *policy,
*policy_nodes = node_states[N_HIGH_MEMORY];
err = 0;
}
+
+ *mode_flags = 0;
if (flags) {
+ /*
+ * Currently, we only support two mutually exclusive
+ * mode flags.
+ */
if (!strcmp(flags, "static"))
*mode_flags |= MPOL_F_STATIC_NODES;
- if (!strcmp(flags, "relative"))
+ else if (!strcmp(flags, "relative"))
*mode_flags |= MPOL_F_RELATIVE_NODES;
-
- if ((*mode_flags & MPOL_F_STATIC_NODES) &&
- (*mode_flags & MPOL_F_RELATIVE_NODES))
- err = 1;
+ else
+ err = 1; /* unrecognized flag */
}
out:
/* Restore string for error message */
if (nodelist)
*--nodelist = ':';
+ if (flags)
+ *--flags = '=';
return err;
}