All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Make xenstored EOF-safe
@ 2007-11-27 15:00 Samuel Thibault
  2007-11-28  3:34 ` Keir Fraser
  0 siblings, 1 reply; 3+ messages in thread
From: Samuel Thibault @ 2007-11-27 15:00 UTC (permalink / raw)
  To: xen-devel

As bug 968 suggests, xenstored must properly handle EOF from clients.

From: Pavel Kankovsky <peak@argo.troja.mff.cuni.cz>
Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>

diff -r 6fd17d0dcbcd tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c	Tue Nov 27 12:49:16 2007 +0000
+++ b/tools/xenstore/xenstored_core.c	Tue Nov 27 14:56:35 2007 +0000
@@ -1266,7 +1266,7 @@ static void handle_input(struct connecti
 	if (in->inhdr) {
 		bytes = conn->read(conn, in->hdr.raw + in->used,
 				   sizeof(in->hdr) - in->used);
-		if (bytes < 0)
+		if (bytes <= 0)
 			goto bad_client;
 		in->used += bytes;
 		if (in->used != sizeof(in->hdr))
@@ -1288,7 +1288,7 @@ static void handle_input(struct connecti
 
 	bytes = conn->read(conn, in->buffer + in->used,
 			   in->hdr.msg.len - in->used);
-	if (bytes < 0)
+	if (bytes <= 0)
 		goto bad_client;
 
 	in->used += bytes;

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

* Re: [PATCH] Make xenstored EOF-safe
  2007-11-27 15:00 [PATCH] Make xenstored EOF-safe Samuel Thibault
@ 2007-11-28  3:34 ` Keir Fraser
  2007-11-28 10:11   ` Samuel Thibault
  0 siblings, 1 reply; 3+ messages in thread
From: Keir Fraser @ 2007-11-28  3:34 UTC (permalink / raw)
  To: Samuel Thibault, xen-devel

Xen-unstable 15643 introduced this bug, but it should have been fixed
satisfactorily by 15644 I think? The idea being that the read hook function
is responsible for turning EOF into an explicit error with rc==-1.

 -- Keir

On 27/11/07 15:00, "Samuel Thibault" <samuel.thibault@eu.citrix.com> wrote:

> As bug 968 suggests, xenstored must properly handle EOF from clients.
> 
> From: Pavel Kankovsky <peak@argo.troja.mff.cuni.cz>
> Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
> 
> diff -r 6fd17d0dcbcd tools/xenstore/xenstored_core.c
> --- a/tools/xenstore/xenstored_core.c Tue Nov 27 12:49:16 2007 +0000
> +++ b/tools/xenstore/xenstored_core.c Tue Nov 27 14:56:35 2007 +0000
> @@ -1266,7 +1266,7 @@ static void handle_input(struct connecti
> if (in->inhdr) {
> bytes = conn->read(conn, in->hdr.raw + in->used,
>   sizeof(in->hdr) - in->used);
> -  if (bytes < 0)
> +  if (bytes <= 0)
> goto bad_client;
> in->used += bytes;
> if (in->used != sizeof(in->hdr))
> @@ -1288,7 +1288,7 @@ static void handle_input(struct connecti
>  
> bytes = conn->read(conn, in->buffer + in->used,
>   in->hdr.msg.len - in->used);
> - if (bytes < 0)
> + if (bytes <= 0)
> goto bad_client;
>  
> in->used += bytes;
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

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

* Re: [PATCH] Make xenstored EOF-safe
  2007-11-28  3:34 ` Keir Fraser
@ 2007-11-28 10:11   ` Samuel Thibault
  0 siblings, 0 replies; 3+ messages in thread
From: Samuel Thibault @ 2007-11-28 10:11 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

Keir Fraser, le Wed 28 Nov 2007 03:34:07 +0000, a écrit :
> Xen-unstable 15643 introduced this bug, but it should have been fixed
> satisfactorily by 15644 I think?

Aow yes, I didn't notice that "read" in new_connection was actually a
parameter of that function. I closed the bug.

Samuel

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

end of thread, other threads:[~2007-11-28 10:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-27 15:00 [PATCH] Make xenstored EOF-safe Samuel Thibault
2007-11-28  3:34 ` Keir Fraser
2007-11-28 10:11   ` Samuel Thibault

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.