Commit a210906c authored by Hugh Dickins's avatar Hugh Dickins Committed by Linus Torvalds

mount -t tmpfs -o mpol=: check nodes online

Randy Dunlap reports that a tmpfs, mounted with NUMA mpol= specifying an
offline node, crashes as soon as data is allocated upon it.  Now restrict it
to online nodes, where before it restricted to MAX_NUMNODES.
Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
Cc: Robin Holt <holt@sgi.com>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Andi Kleen <ak@suse.de>
Tested-and-acked-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9739ed1c
...@@ -94,10 +94,10 @@ largest node numbers in the range. For example, mpol=bind:0-3,5,7,9-15 ...@@ -94,10 +94,10 @@ largest node numbers in the range. For example, mpol=bind:0-3,5,7,9-15
Note that trying to mount a tmpfs with an mpol option will fail if the Note that trying to mount a tmpfs with an mpol option will fail if the
running kernel does not support NUMA; and will fail if its nodelist running kernel does not support NUMA; and will fail if its nodelist
specifies a node >= MAX_NUMNODES. If your system relies on that tmpfs specifies a node which is not online. If your system relies on that
being mounted, but from time to time runs a kernel built without NUMA tmpfs being mounted, but from time to time runs a kernel built without
capability (perhaps a safe recovery kernel), or configured to support NUMA capability (perhaps a safe recovery kernel), or with fewer nodes
fewer nodes, then it is advisable to omit the mpol option from automatic online, then it is advisable to omit the mpol option from automatic
mount options. It can be added later, when the tmpfs is already mounted mount options. It can be added later, when the tmpfs is already mounted
on MountPoint, by 'mount -o remount,mpol=Policy:NodeList MountPoint'. on MountPoint, by 'mount -o remount,mpol=Policy:NodeList MountPoint'.
...@@ -121,4 +121,4 @@ RAM/SWAP in 10240 inodes and it is only accessible by root. ...@@ -121,4 +121,4 @@ RAM/SWAP in 10240 inodes and it is only accessible by root.
Author: Author:
Christoph Rohland <cr@sap.com>, 1.12.01 Christoph Rohland <cr@sap.com>, 1.12.01
Updated: Updated:
Hugh Dickins <hugh@veritas.com>, 19 February 2006 Hugh Dickins <hugh@veritas.com>, 4 June 2007
...@@ -967,6 +967,8 @@ static inline int shmem_parse_mpol(char *value, int *policy, nodemask_t *policy_ ...@@ -967,6 +967,8 @@ static inline int shmem_parse_mpol(char *value, int *policy, nodemask_t *policy_
*nodelist++ = '\0'; *nodelist++ = '\0';
if (nodelist_parse(nodelist, *policy_nodes)) if (nodelist_parse(nodelist, *policy_nodes))
goto out; goto out;
if (!nodes_subset(*policy_nodes, node_online_map))
goto out;
} }
if (!strcmp(value, "default")) { if (!strcmp(value, "default")) {
*policy = MPOL_DEFAULT; *policy = MPOL_DEFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment