提交 d3ed11c3 编写于 作者: P Paul Menage 提交者: Linus Torvalds

[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: NPaul Menage <menage@google.com>
Acked-by: NPaul Jackson <pj@sgi.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 09b88252
...@@ -1280,7 +1280,8 @@ typedef enum { ...@@ -1280,7 +1280,8 @@ typedef enum {
FILE_TASKLIST, FILE_TASKLIST,
} cpuset_filetype_t; } cpuset_filetype_t;
static ssize_t cpuset_common_file_write(struct file *file, const char __user *userbuf, static ssize_t cpuset_common_file_write(struct file *file,
const char __user *userbuf,
size_t nbytes, loff_t *unused_ppos) size_t nbytes, loff_t *unused_ppos)
{ {
struct cpuset *cs = __d_cs(file->f_dentry->d_parent); 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,7 +1292,7 @@ static ssize_t cpuset_common_file_write(struct file *file, const char __user *us
int retval = 0; int retval = 0;
/* Crude upper limit on largest legitimate cpulist user might write. */ /* Crude upper limit on largest legitimate cpulist user might write. */
if (nbytes > 100 + 6 * NR_CPUS) if (nbytes > 100 + 6 * max(NR_CPUS, MAX_NUMNODES))
return -E2BIG; return -E2BIG;
/* +1 for nul-terminator */ /* +1 for nul-terminator */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册