public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 15/20] UML - Fix infinite mconsole loop
@ 2008-01-17 21:40 Jeff Dike
  0 siblings, 0 replies; only message in thread
From: Jeff Dike @ 2008-01-17 21:40 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Karol Swietlicki, uml-devel, LKML

From: Karol Swietlicki <magotari@gmail.com>

This patch takes care of a problem with the stopping code.

The function inside the while condition returns 0 to signify a problem.
A problem could be for example a bad command or a bad version of the
mconsole client.
A bad command would terminate the stopping loop and resume the kernel.
This is a problem.

A better solution is to make the loop infinite and don't leave it
until we are explicitly told to.

Signed-off-by: Karol Swietlicki <magotari@gmail.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
---
 arch/um/drivers/mconsole_kern.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6.22/arch/um/drivers/mconsole_kern.c
===================================================================
--- linux-2.6.22.orig/arch/um/drivers/mconsole_kern.c	2007-12-12 13:44:20.000000000 -0500
+++ linux-2.6.22/arch/um/drivers/mconsole_kern.c	2007-12-12 15:53:08.000000000 -0500
@@ -305,7 +305,9 @@ void mconsole_stop(struct mc_request *re
 	deactivate_fd(req->originating_fd, MCONSOLE_IRQ);
 	os_set_fd_block(req->originating_fd, 1);
 	mconsole_reply(req, "stopped", 0, 0);
-	while (mconsole_get_request(req->originating_fd, req)) {
+	for (;;) {
+		if (!mconsole_get_request(req->originating_fd, req))
+			continue;
 		if (req->cmd->handler == mconsole_go)
 			break;
 		if (req->cmd->handler == mconsole_stop) {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-01-17 21:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-17 21:40 [PATCH 15/20] UML - Fix infinite mconsole loop Jeff Dike

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