public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5][BUG] SUBCPUSETS: fix for cpusets minor problem
@ 2005-09-08  5:40 KUROSAWA Takahiro
  2005-09-08 11:17 ` Robin Holt
  0 siblings, 1 reply; 4+ messages in thread
From: KUROSAWA Takahiro @ 2005-09-08  5:40 UTC (permalink / raw)
  To: linux-kernel

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>

--- from-0001/kernel/cpuset.c
+++ to-work/kernel/cpuset.c	2005-09-05 20:26:18.075772762 +0900
@@ -984,6 +984,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));

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/5][BUG] SUBCPUSETS: fix for cpusets minor problem
  2005-09-08  5:40 [PATCH 1/5][BUG] SUBCPUSETS: fix for cpusets minor problem KUROSAWA Takahiro
@ 2005-09-08 11:17 ` Robin Holt
  2005-09-08 11:25   ` Robin Holt
  0 siblings, 1 reply; 4+ messages in thread
From: Robin Holt @ 2005-09-08 11:17 UTC (permalink / raw)
  To: Paul Jackson, KUROSAWA Takahiro; +Cc: linux-kernel

On Thu, Sep 08, 2005 at 02:40:53PM +0900, KUROSAWA Takahiro wrote:
> 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>
> 
> --- from-0001/kernel/cpuset.c
> +++ to-work/kernel/cpuset.c	2005-09-05 20:26:18.075772762 +0900
> @@ -984,6 +984,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));


Paul,  I think this should go in regardless of the other subcpuset
changes being proposed.  What do you think?

Robin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/5][BUG] SUBCPUSETS: fix for cpusets minor problem
  2005-09-08 11:17 ` Robin Holt
@ 2005-09-08 11:25   ` Robin Holt
  2005-09-08 11:58     ` Paul Jackson
  0 siblings, 1 reply; 4+ messages in thread
From: Robin Holt @ 2005-09-08 11:25 UTC (permalink / raw)
  To: Robin Holt; +Cc: Paul Jackson, KUROSAWA Takahiro, linux-kernel

On Thu, Sep 08, 2005 at 06:17:31AM -0500, Robin Holt wrote:
> On Thu, Sep 08, 2005 at 02:40:53PM +0900, KUROSAWA Takahiro wrote:
> > 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>
> > 
> > --- from-0001/kernel/cpuset.c
> > +++ to-work/kernel/cpuset.c	2005-09-05 20:26:18.075772762 +0900
> > @@ -984,6 +984,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));
> 
> 
> Paul,  I think this should go in regardless of the other subcpuset
> changes being proposed.  What do you think?


Oops, didn't see you had already sent it along.  Sorry, Robin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/5][BUG] SUBCPUSETS: fix for cpusets minor problem
  2005-09-08 11:25   ` Robin Holt
@ 2005-09-08 11:58     ` Paul Jackson
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Jackson @ 2005-09-08 11:58 UTC (permalink / raw)
  To: Robin Holt; +Cc: holt, kurosawa, linux-kernel

Robin wrote:
> Oops, didn't see you had already sent it along.

Looks like you, me, Takahiro-san and Andrew are all in agreement
on sending this Patch 1/5 along.

Excellent.

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@sgi.com> 1.925.600.0401

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-08 11:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-08  5:40 [PATCH 1/5][BUG] SUBCPUSETS: fix for cpusets minor problem KUROSAWA Takahiro
2005-09-08 11:17 ` Robin Holt
2005-09-08 11:25   ` Robin Holt
2005-09-08 11:58     ` Paul Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox