Skip to content

Commit

Permalink
mempolicy: don't call mpol_set_nodemask() when no_context
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Lee Schermerhorn authored and torvalds committed May 25, 2010
1 parent 1980050 commit e17f74a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2239,7 +2239,10 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context)
if (IS_ERR(new))
goto out;

{
if (no_context) {
/* save for contextualization */
new->w.user_nodemask = nodes;
} else {
int ret;
NODEMASK_SCRATCH(scratch);
if (scratch) {
Expand All @@ -2255,10 +2258,6 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context)
}
}
err = 0;
if (no_context) {
/* save for contextualization */
new->w.user_nodemask = nodes;
}

out:
/* Restore string for error message */
Expand Down

0 comments on commit e17f74a

Please sign in to comment.