Skip to content

Commit e17f74a

Browse files
Lee Schermerhorntorvalds
authored andcommitted
mempolicy: don't call mpol_set_nodemask() when no_context
No need to call mpol_set_nodemask() when we have no context for the mempolicy. This can occur when we're parsing a tmpfs 'mpol' mount option. Just save the raw nodemask in the mempolicy's w.user_nodemask member for use when a tmpfs/shmem file is created. mpol_shared_policy_init() will "contextualize" the policy for the new file based on the creating task's context. Signed-off-by: Lee Schermerhorn <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Ravikiran Thirumalai <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: David Rientjes <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 1980050 commit e17f74a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

mm/mempolicy.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,7 +2239,10 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context)
22392239
if (IS_ERR(new))
22402240
goto out;
22412241

2242-
{
2242+
if (no_context) {
2243+
/* save for contextualization */
2244+
new->w.user_nodemask = nodes;
2245+
} else {
22432246
int ret;
22442247
NODEMASK_SCRATCH(scratch);
22452248
if (scratch) {
@@ -2255,10 +2258,6 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context)
22552258
}
22562259
}
22572260
err = 0;
2258-
if (no_context) {
2259-
/* save for contextualization */
2260-
new->w.user_nodemask = nodes;
2261-
}
22622261

22632262
out:
22642263
/* Restore string for error message */

0 commit comments

Comments
 (0)