diff options
author | Paul Menage <menage@google.com> | 2006-12-06 23:41:37 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:48 -0500 |
commit | d3ed11c35635487d34ad476e1d6a66dd298ab2de (patch) | |
tree | 1317e066282dda6b9d4ee44b4f62bfee94625ee1 /kernel | |
parent | 09b882520bbe01f2e5044642109c1c1d19fe3559 (diff) |
[PATCH] cpuset: allow a larger buffer for writes to cpuset files
When using fake NUMA setup, the number of memory nodes can greatly exceed
the number of CPUs. So the current limit in cpuset_common_file_write() is
insufficient.
Signed-off-by: Paul Menage <menage@google.com>
Acked-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cpuset.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 4ef1d29297ca..0a6b4d89f9a0 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -1280,7 +1280,8 @@ typedef enum { | |||
1280 | FILE_TASKLIST, | 1280 | FILE_TASKLIST, |
1281 | } cpuset_filetype_t; | 1281 | } cpuset_filetype_t; |
1282 | 1282 | ||
1283 | static ssize_t cpuset_common_file_write(struct file *file, const char __user *userbuf, | 1283 | static ssize_t cpuset_common_file_write(struct file *file, |
1284 | const char __user *userbuf, | ||
1284 | size_t nbytes, loff_t *unused_ppos) | 1285 | size_t nbytes, loff_t *unused_ppos) |
1285 | { | 1286 | { |
1286 | struct cpuset *cs = __d_cs(file->f_dentry->d_parent); | 1287 | struct cpuset *cs = __d_cs(file->f_dentry->d_parent); |
@@ -1291,7 +1292,7 @@ static ssize_t cpuset_common_file_write(struct file *file, const char __user *us | |||
1291 | int retval = 0; | 1292 | int retval = 0; |
1292 | 1293 | ||
1293 | /* Crude upper limit on largest legitimate cpulist user might write. */ | 1294 | /* Crude upper limit on largest legitimate cpulist user might write. */ |
1294 | if (nbytes > 100 + 6 * NR_CPUS) | 1295 | if (nbytes > 100 + 6 * max(NR_CPUS, MAX_NUMNODES)) |
1295 | return -E2BIG; | 1296 | return -E2BIG; |
1296 | 1297 | ||
1297 | /* +1 for nul-terminator */ | 1298 | /* +1 for nul-terminator */ |