Skip to content

Commit

Permalink
[PATCH] fix for cpusets minor problem
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
KUROSAWA Takahiro authored and Linus Torvalds committed Sep 9, 2005
1 parent ac0b1bc commit 73a358d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 73a358d

Please sign in to comment.