From: KUROSAWA Takahiro 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 Cc: Paul Jackson Signed-off-by: Andrew Morton --- kernel/cpuset.c | 4 ++++ 1 files changed, 4 insertions(+) diff -puN kernel/cpuset.c~subcpusets-fix-for-cpusets-minor-problem kernel/cpuset.c --- devel/kernel/cpuset.c~subcpusets-fix-for-cpusets-minor-problem 2005-09-07 23:15:52.000000000 -0700 +++ devel-akpm/kernel/cpuset.c 2005-09-07 23:15:52.000000000 -0700 @@ -972,6 +972,10 @@ static ssize_t cpuset_common_file_read(s *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)); _