From: KUROSAWA Takahiro Date: Fri, 9 Sep 2005 20:02:10 +0000 (-0700) Subject: [PATCH] fix for cpusets minor problem X-Git-Tag: v2.6.14-rc1~449 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73a358d1892a8233801e3fd54668075b52ec42da;p=platform%2Fkernel%2Flinux-exynos.git [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 Acked-by: Paul Jackson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 1f06e76..712d020 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, *s++ = '\n'; *s = '\0'; + /* Do nothing if *ppos is at the eof or beyond the eof. */ + if (s - page <= *ppos) + return 0; + start = page + *ppos; n = s - start; retval = n - copy_to_user(buf, start, min(n, nbytes));