Commit 73a358d1 authored by KUROSAWA Takahiro's avatar KUROSAWA Takahiro Committed by Linus Torvalds

[PATCH] fix for cpusets minor problem

This patch fixes minor problem that the CPUSETS have when files in the
cpuset filesystem are read after lseek()-ed beyond the EOF.
Signed-off-by: default avatarKUROSAWA Takahiro <kurosawa@valinux.co.jp>
Acked-by: default avatarPaul Jackson <pj@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ac0b1bc1
...@@ -972,6 +972,10 @@ static ssize_t cpuset_common_file_read(struct file *file, char __user *buf, ...@@ -972,6 +972,10 @@ static ssize_t cpuset_common_file_read(struct file *file, char __user *buf,
*s++ = '\n'; *s++ = '\n';
*s = '\0'; *s = '\0';
/* Do nothing if *ppos is at the eof or beyond the eof. */
if (s - page <= *ppos)
return 0;
start = page + *ppos; start = page + *ppos;
n = s - start; n = s - start;
retval = n - copy_to_user(buf, start, min(n, nbytes)); retval = n - copy_to_user(buf, start, min(n, nbytes));
......
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