All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] [PATCH] uml: Fix unintentional resumes in mconsole stop code.
@ 2007-12-12  0:18 Karol Swietlicki
  2007-12-12 20:54 ` Jeff Dike
  0 siblings, 1 reply; 2+ messages in thread
From: Karol Swietlicki @ 2007-12-12  0:18 UTC (permalink / raw)
  To: Jeff Dike; +Cc: uml-devel

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.

Karol Swietlicki

Signed-off-by: Karol Swietlicki <magotari@gmail.com>
---
diff -rupN linux-2.6.24-rc4.orig/arch/um/drivers/mconsole_kern.c
linux-2.6.24-rc4/arch/um/drivers/mconsole_kern.c
--- linux-2.6.24-rc4.orig/arch/um/drivers/mconsole_kern.c	2007-12-12
00:58:17.000000000 +0100
+++ linux-2.6.24-rc4/arch/um/drivers/mconsole_kern.c	2007-12-12
01:00:33.000000000 +0100
@@ -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) {

-------------------------------------------------------------------------
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

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

* Re: [uml-devel] [PATCH] uml: Fix unintentional resumes in mconsole stop code.
  2007-12-12  0:18 [uml-devel] [PATCH] uml: Fix unintentional resumes in mconsole stop code Karol Swietlicki
@ 2007-12-12 20:54 ` Jeff Dike
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Dike @ 2007-12-12 20:54 UTC (permalink / raw)
  To: Karol Swietlicki; +Cc: uml-devel

On Wed, Dec 12, 2007 at 01:18:51AM +0100, Karol Swietlicki wrote:
> This patch takes care of a problem with the stopping code.

Thanks, I'll send this in in the next few days.

				Jeff

-- 
Work email - jdike at linux dot intel dot com

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

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

end of thread, other threads:[~2007-12-12 20:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-12  0:18 [uml-devel] [PATCH] uml: Fix unintentional resumes in mconsole stop code Karol Swietlicki
2007-12-12 20:54 ` Jeff Dike

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.