aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorKUROSAWA Takahiro <kurosawa@valinux.co.jp>2005-09-09 16:02:10 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 16:57:32 -0400
commit73a358d1892a8233801e3fd54668075b52ec42da (patch)
tree851250c42eb890c6fa3afe59b3398e17ee850bae /kernel
parentac0b1bc1edbe81c0cb36cad7e7f5b91f4d9e12ed (diff)
[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: KUROSAWA Takahiro <kurosawa@valinux.co.jp> 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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 1f06e7690106..712d02029971 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -972,6 +972,10 @@ static ssize_t cpuset_common_file_read(struct file *file, char __user *buf,
972 *s++ = '\n'; 972 *s++ = '\n';
973 *s = '\0'; 973 *s = '\0';
974 974
975 /* Do nothing if *ppos is at the eof or beyond the eof. */
976 if (s - page <= *ppos)
977 return 0;
978
975 start = page + *ppos; 979 start = page + *ppos;
976 n = s - start; 980 n = s - start;
977 retval = n - copy_to_user(buf, start, min(n, nbytes)); 981 retval = n - copy_to_user(buf, start, min(n, nbytes));