All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] [PATCH 1/4] um: ubd: Add REQ_FLUSH suppport
@ 2013-08-18 11:30 Richard Weinberger
  2013-08-18 11:30 ` [uml-devel] [PATCH 2/4] um: ubd: Introduce submit_request() Richard Weinberger
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Richard Weinberger @ 2013-08-18 11:30 UTC (permalink / raw)
  To: richard; +Cc: user-mode-linux-devel

UML's block device driver does not support write barriers,
to support this this patch adds REQ_FLUSH suppport.
Every time the block layer sends a REQ_FLUSH we fsync() now
our backing file to guarantee data consistency.

Cc: rjones@redhat.com
Reported-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 arch/um/drivers/ubd_kern.c  | 41 ++++++++++++++++++++++++++++++++++++++++-
 arch/um/include/shared/os.h |  1 +
 arch/um/os-Linux/file.c     |  9 +++++++++
 3 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 879990c..d27c703 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -41,7 +41,7 @@
 #include <os.h>
 #include "cow.h"
 
-enum ubd_req { UBD_READ, UBD_WRITE };
+enum ubd_req { UBD_READ, UBD_WRITE, UBD_FLUSH };
 
 struct io_thread_req {
 	struct request *req;
@@ -866,6 +866,7 @@ static int ubd_add(int n, char **error_out)
 		goto out;
 	}
 	ubd_dev->queue->queuedata = ubd_dev;
+	blk_queue_flush(ubd_dev->queue, REQ_FLUSH);
 
 	blk_queue_max_segments(ubd_dev->queue, MAX_SG);
 	err = ubd_disk_register(UBD_MAJOR, ubd_dev->size, n, &ubd_gendisk[n]);
@@ -1239,6 +1240,19 @@ static void prepare_request(struct request *req, struct io_thread_req *io_req,
 }
 
 /* Called with dev->lock held */
+static void prepare_flush_request(struct request *req,
+				  struct io_thread_req *io_req)
+{
+	struct gendisk *disk = req->rq_disk;
+	struct ubd *ubd_dev = disk->private_data;
+
+	io_req->req = req;
+	io_req->fds[0] = (ubd_dev->cow.file != NULL) ? ubd_dev->cow.fd :
+		ubd_dev->fd;
+	io_req->op = UBD_FLUSH;
+}
+
+/* Called with dev->lock held */
 static void do_ubd_request(struct request_queue *q)
 {
 	struct io_thread_req *io_req;
@@ -1259,6 +1273,20 @@ static void do_ubd_request(struct request_queue *q)
 		}
 
 		req = dev->request;
+
+		if (req->cmd_flags & REQ_FLUSH) {
+			io_req = kmalloc(sizeof(struct io_thread_req),
+					 GFP_ATOMIC);
+			if (io_req == NULL) {
+				if (list_empty(&dev->restart))
+					list_add(&dev->restart, &restart);
+				return;
+			}
+			prepare_flush_request(req, io_req);
+			os_write_file(thread_fd, &io_req,
+					  sizeof(struct io_thread_req *));
+		}
+
 		while(dev->start_sg < dev->end_sg){
 			struct scatterlist *sg = &dev->sg[dev->start_sg];
 
@@ -1367,6 +1395,17 @@ static void do_io(struct io_thread_req *req)
 	int err;
 	__u64 off;
 
+	if (req->op == UBD_FLUSH) {
+		/* fds[0] is always either the rw image or our cow file */
+		n = os_sync_file(req->fds[0]);
+		if (n != 0) {
+			printk("do_io - sync failed err = %d "
+			       "fd = %d\n", -n, req->fds[0]);
+			req->error = 1;
+		}
+		return;
+	}
+
 	nsectors = req->length / req->sectorsize;
 	start = 0;
 	do {
diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h
index 95feaa4..04859b7 100644
--- a/arch/um/include/shared/os.h
+++ b/arch/um/include/shared/os.h
@@ -141,6 +141,7 @@ extern int os_seek_file(int fd, unsigned long long offset);
 extern int os_open_file(const char *file, struct openflags flags, int mode);
 extern int os_read_file(int fd, void *buf, int len);
 extern int os_write_file(int fd, const void *buf, int count);
+extern int os_sync_file(int fd);
 extern int os_file_size(const char *file, unsigned long long *size_out);
 extern int os_file_modtime(const char *file, unsigned long *modtime);
 extern int os_pipe(int *fd, int stream, int close_on_exec);
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
index c17bd6f..07a7501 100644
--- a/arch/um/os-Linux/file.c
+++ b/arch/um/os-Linux/file.c
@@ -266,6 +266,15 @@ int os_write_file(int fd, const void *buf, int len)
 	return n;
 }
 
+int os_sync_file(int fd)
+{
+	int n = fsync(fd);
+
+	if (n < 0)
+		return -errno;
+	return n;
+}
+
 int os_file_size(const char *file, unsigned long long *size_out)
 {
 	struct uml_stat buf;
-- 
1.8.3.1


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
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 related	[flat|nested] 10+ messages in thread

* [uml-devel] [PATCH 2/4] um: ubd: Introduce submit_request()
  2013-08-18 11:30 [uml-devel] [PATCH 1/4] um: ubd: Add REQ_FLUSH suppport Richard Weinberger
@ 2013-08-18 11:30 ` Richard Weinberger
  2013-08-18 11:30 ` [uml-devel] [PATCH 3/4] um: Cleanup SIGTERM handling Richard Weinberger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Richard Weinberger @ 2013-08-18 11:30 UTC (permalink / raw)
  To: richard; +Cc: user-mode-linux-devel

Just a clean-up patch to remove the open coded
variants and to ensure that all requests are submitted the
same way.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 arch/um/drivers/ubd_kern.c | 32 +++++++++++++++++++-------------
 1 file changed, 19 insertions(+), 13 deletions(-)

diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index d27c703..1812bc8 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -1252,12 +1252,28 @@ static void prepare_flush_request(struct request *req,
 	io_req->op = UBD_FLUSH;
 }
 
+static bool submit_request(struct io_thread_req *io_req, struct ubd *dev)
+{
+	int n = os_write_file(thread_fd, &io_req,
+			     sizeof(io_req));
+	if (n != sizeof(io_req)) {
+		if (n != -EAGAIN)
+			printk("write to io thread failed, "
+			       "errno = %d\n", -n);
+		else if (list_empty(&dev->restart))
+			list_add(&dev->restart, &restart);
+
+		kfree(io_req);
+		return false;
+	}
+	return true;
+}
+
 /* Called with dev->lock held */
 static void do_ubd_request(struct request_queue *q)
 {
 	struct io_thread_req *io_req;
 	struct request *req;
-	int n;
 
 	while(1){
 		struct ubd *dev = q->queuedata;
@@ -1283,8 +1299,7 @@ static void do_ubd_request(struct request_queue *q)
 				return;
 			}
 			prepare_flush_request(req, io_req);
-			os_write_file(thread_fd, &io_req,
-					  sizeof(struct io_thread_req *));
+			submit_request(io_req, dev);
 		}
 
 		while(dev->start_sg < dev->end_sg){
@@ -1301,17 +1316,8 @@ static void do_ubd_request(struct request_queue *q)
 					(unsigned long long)dev->rq_pos << 9,
 					sg->offset, sg->length, sg_page(sg));
 
-			n = os_write_file(thread_fd, &io_req,
-					  sizeof(struct io_thread_req *));
-			if(n != sizeof(struct io_thread_req *)){
-				if(n != -EAGAIN)
-					printk("write to io thread failed, "
-					       "errno = %d\n", -n);
-				else if(list_empty(&dev->restart))
-					list_add(&dev->restart, &restart);
-				kfree(io_req);
+			if (submit_request(io_req, dev) == false)
 				return;
-			}
 
 			dev->rq_pos += sg->length >> 9;
 			dev->start_sg++;
-- 
1.8.3.1


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
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 related	[flat|nested] 10+ messages in thread

* [uml-devel] [PATCH 3/4] um: Cleanup SIGTERM handling
  2013-08-18 11:30 [uml-devel] [PATCH 1/4] um: ubd: Add REQ_FLUSH suppport Richard Weinberger
  2013-08-18 11:30 ` [uml-devel] [PATCH 2/4] um: ubd: Introduce submit_request() Richard Weinberger
@ 2013-08-18 11:30 ` Richard Weinberger
  2013-08-19  9:28   ` Richard W.M. Jones
  2013-08-18 11:30 ` [uml-devel] [PATCH 4/4] um: Run UML in it's own session Richard Weinberger
  2013-08-19  9:21 ` [uml-devel] [PATCH 1/4] um: ubd: Add REQ_FLUSH suppport Richard W.M. Jones
  3 siblings, 1 reply; 10+ messages in thread
From: Richard Weinberger @ 2013-08-18 11:30 UTC (permalink / raw)
  To: richard; +Cc: user-mode-linux-devel

Richard reported that some UML processes survive if the UML
main process receives a SIGTERM.
This issue was caused by a wrongly placed signal(SIGTERM, SIG_DFL)
in init_new_thread_signals().
It disabled the UML exit handler accidently for some processes.
The correct solution is to disable the fatal handler for all
UML helper threads/processes.
Such that last_ditch_exit() does not get called multiple times
and all processes can exit due to SIGTERM.

Cc: rjones@redhat.com
Reported-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 arch/um/drivers/ubd.h       |  1 -
 arch/um/drivers/ubd_kern.c  |  3 ++-
 arch/um/drivers/ubd_user.c  |  5 -----
 arch/um/include/shared/os.h |  1 +
 arch/um/os-Linux/aio.c      |  5 ++---
 arch/um/os-Linux/process.c  |  1 -
 arch/um/os-Linux/sigio.c    |  2 +-
 arch/um/os-Linux/util.c     | 10 ++++++++++
 8 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/arch/um/drivers/ubd.h b/arch/um/drivers/ubd.h
index 3845051..3b48cd2 100644
--- a/arch/um/drivers/ubd.h
+++ b/arch/um/drivers/ubd.h
@@ -7,7 +7,6 @@
 #ifndef __UM_UBD_USER_H
 #define __UM_UBD_USER_H
 
-extern void ignore_sigwinch_sig(void);
 extern int start_io_thread(unsigned long sp, int *fds_out);
 extern int io_thread(void *arg);
 extern int kernel_fd;
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 1812bc8..3716e69 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -1476,7 +1476,8 @@ int io_thread(void *arg)
 	struct io_thread_req *req;
 	int n;
 
-	ignore_sigwinch_sig();
+	os_fix_helper_signals();
+
 	while(1){
 		n = os_read_file(kernel_fd, &req,
 				 sizeof(struct io_thread_req *));
diff --git a/arch/um/drivers/ubd_user.c b/arch/um/drivers/ubd_user.c
index a703e45..e376f9b 100644
--- a/arch/um/drivers/ubd_user.c
+++ b/arch/um/drivers/ubd_user.c
@@ -21,11 +21,6 @@
 #include "ubd.h"
 #include <os.h>
 
-void ignore_sigwinch_sig(void)
-{
-	signal(SIGWINCH, SIG_IGN);
-}
-
 int start_io_thread(unsigned long sp, int *fd_out)
 {
 	int pid, fds[2], err;
diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h
index 04859b7..24d8077 100644
--- a/arch/um/include/shared/os.h
+++ b/arch/um/include/shared/os.h
@@ -234,6 +234,7 @@ extern void setup_machinename(char *machine_out);
 extern void setup_hostinfo(char *buf, int len);
 extern void os_dump_core(void) __attribute__ ((noreturn));
 extern void um_early_printk(const char *s, unsigned int n);
+extern void os_fix_helper_signals(void);
 
 /* time.c */
 extern void idle_sleep(unsigned long long nsecs);
diff --git a/arch/um/os-Linux/aio.c b/arch/um/os-Linux/aio.c
index 3a6bc2a..014eb35 100644
--- a/arch/um/os-Linux/aio.c
+++ b/arch/um/os-Linux/aio.c
@@ -104,8 +104,7 @@ static int aio_thread(void *arg)
 	struct io_event event;
 	int err, n, reply_fd;
 
-	signal(SIGWINCH, SIG_IGN);
-
+	os_fix_helper_signals();
 	while (1) {
 		n = io_getevents(ctx, 1, 1, &event, NULL);
 		if (n < 0) {
@@ -173,7 +172,7 @@ static int not_aio_thread(void *arg)
 	struct aio_thread_reply reply;
 	int err;
 
-	signal(SIGWINCH, SIG_IGN);
+	os_fix_helper_signals();
 	while (1) {
 		err = read(aio_req_fd_r, &req, sizeof(req));
 		if (err != sizeof(req)) {
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c
index b8f34c9..7cd61ea 100644
--- a/arch/um/os-Linux/process.c
+++ b/arch/um/os-Linux/process.c
@@ -242,5 +242,4 @@ void init_new_thread_signals(void)
 	signal(SIGHUP, SIG_IGN);
 	set_handler(SIGIO);
 	signal(SIGWINCH, SIG_IGN);
-	signal(SIGTERM, SIG_DFL);
 }
diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c
index 8b61cc0..46e762f 100644
--- a/arch/um/os-Linux/sigio.c
+++ b/arch/um/os-Linux/sigio.c
@@ -55,7 +55,7 @@ static int write_sigio_thread(void *unused)
 	int i, n, respond_fd;
 	char c;
 
-	signal(SIGWINCH, SIG_IGN);
+	os_fix_helper_signals();
 	fds = &current_poll;
 	while (1) {
 		n = poll(fds->poll, fds->used, -1);
diff --git a/arch/um/os-Linux/util.c b/arch/um/os-Linux/util.c
index 492ef5e..faee55e 100644
--- a/arch/um/os-Linux/util.c
+++ b/arch/um/os-Linux/util.c
@@ -94,6 +94,16 @@ static inline void __attribute__ ((noreturn)) uml_abort(void)
 			exit(127);
 }
 
+/*
+ * UML helper threads must not handle SIGWINCH/INT/TERM
+ */
+void os_fix_helper_signals(void)
+{
+	signal(SIGWINCH, SIG_IGN);
+	signal(SIGINT, SIG_DFL);
+	signal(SIGTERM, SIG_DFL);
+}
+
 void os_dump_core(void)
 {
 	int pid;
-- 
1.8.3.1


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
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 related	[flat|nested] 10+ messages in thread

* [uml-devel] [PATCH 4/4] um: Run UML in it's own session.
  2013-08-18 11:30 [uml-devel] [PATCH 1/4] um: ubd: Add REQ_FLUSH suppport Richard Weinberger
  2013-08-18 11:30 ` [uml-devel] [PATCH 2/4] um: ubd: Introduce submit_request() Richard Weinberger
  2013-08-18 11:30 ` [uml-devel] [PATCH 3/4] um: Cleanup SIGTERM handling Richard Weinberger
@ 2013-08-18 11:30 ` Richard Weinberger
  2013-08-19  9:30   ` Richard W.M. Jones
  2013-08-19  9:21 ` [uml-devel] [PATCH 1/4] um: ubd: Add REQ_FLUSH suppport Richard W.M. Jones
  3 siblings, 1 reply; 10+ messages in thread
From: Richard Weinberger @ 2013-08-18 11:30 UTC (permalink / raw)
  To: richard; +Cc: user-mode-linux-devel

If UML is not run by a shell it can happen that UML
will kill unrelated proceses upon a fatal exit because
it issues a kill(0, ...).
To prevent such oddities we create a new session in main().

Cc: rjones@redhat.com
Reported-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 arch/um/os-Linux/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c
index 749c96d..e1704ff 100644
--- a/arch/um/os-Linux/main.c
+++ b/arch/um/os-Linux/main.c
@@ -123,6 +123,8 @@ int __init main(int argc, char **argv, char **envp)
 
 	setup_env_path();
 
+	setsid();
+
 	new_argv = malloc((argc + 1) * sizeof(char *));
 	if (new_argv == NULL) {
 		perror("Mallocing argv");
-- 
1.8.3.1


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
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 related	[flat|nested] 10+ messages in thread

* Re: [uml-devel] [PATCH 1/4] um: ubd: Add REQ_FLUSH suppport
  2013-08-18 11:30 [uml-devel] [PATCH 1/4] um: ubd: Add REQ_FLUSH suppport Richard Weinberger
                   ` (2 preceding siblings ...)
  2013-08-18 11:30 ` [uml-devel] [PATCH 4/4] um: Run UML in it's own session Richard Weinberger
@ 2013-08-19  9:21 ` Richard W.M. Jones
  3 siblings, 0 replies; 10+ messages in thread
From: Richard W.M. Jones @ 2013-08-19  9:21 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: user-mode-linux-devel

On Sun, Aug 18, 2013 at 01:30:06PM +0200, Richard Weinberger wrote:
> UML's block device driver does not support write barriers,
> to support this this patch adds REQ_FLUSH suppport.
> Every time the block layer sends a REQ_FLUSH we fsync() now
> our backing file to guarantee data consistency.
> 
> Cc: rjones@redhat.com
> Reported-by: Richard W.M. Jones <rjones@redhat.com>
> Signed-off-by: Richard Weinberger <richard@nod.at>

Tested-by: Richard W.M. Jones <rjones@redhat.com>

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
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] 10+ messages in thread

* Re: [uml-devel] [PATCH 3/4] um: Cleanup SIGTERM handling
  2013-08-18 11:30 ` [uml-devel] [PATCH 3/4] um: Cleanup SIGTERM handling Richard Weinberger
@ 2013-08-19  9:28   ` Richard W.M. Jones
  0 siblings, 0 replies; 10+ messages in thread
From: Richard W.M. Jones @ 2013-08-19  9:28 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: user-mode-linux-devel

On Sun, Aug 18, 2013 at 01:30:08PM +0200, Richard Weinberger wrote:
> Richard reported that some UML processes survive if the UML
> main process receives a SIGTERM.
> This issue was caused by a wrongly placed signal(SIGTERM, SIG_DFL)
> in init_new_thread_signals().
> It disabled the UML exit handler accidently for some processes.
> The correct solution is to disable the fatal handler for all
> UML helper threads/processes.
> Such that last_ditch_exit() does not get called multiple times
> and all processes can exit due to SIGTERM.
> 
> Cc: rjones@redhat.com
> Reported-by: Richard W.M. Jones <rjones@redhat.com>
> Signed-off-by: Richard Weinberger <richard@nod.at>

I tested this using the libguestfs UML backend, and the original
problem with not all processes being cleared up on exit has been fixed.

I also observed that the exit status has changed from "killed by
SIGTERM" to exit code 1.  Therefore:

Tested-by: Richard W.M. Jones <rjones@redhat.com>

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
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] 10+ messages in thread

* Re: [uml-devel] [PATCH 4/4] um: Run UML in it's own session.
  2013-08-18 11:30 ` [uml-devel] [PATCH 4/4] um: Run UML in it's own session Richard Weinberger
@ 2013-08-19  9:30   ` Richard W.M. Jones
  2013-08-19 20:23     ` Richard Weinberger
  2013-09-07 12:14     ` Richard W.M. Jones
  0 siblings, 2 replies; 10+ messages in thread
From: Richard W.M. Jones @ 2013-08-19  9:30 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: user-mode-linux-devel

On Sun, Aug 18, 2013 at 01:30:09PM +0200, Richard Weinberger wrote:
> If UML is not run by a shell it can happen that UML
> will kill unrelated proceses upon a fatal exit because
> it issues a kill(0, ...).
> To prevent such oddities we create a new session in main().
> 
> Cc: rjones@redhat.com
> Reported-by: Richard W.M. Jones <rjones@redhat.com>
> Signed-off-by: Richard Weinberger <richard@nod.at>

I tested this using the "debug segv" test script that I previously
posted on the user-mode-linux mailing list, and this problem is now
fixed.  Therefore:

Tested-by: Richard W.M. Jones <rjones@redhat.com>

Thanks for these great fixes!

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
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] 10+ messages in thread

* Re: [uml-devel] [PATCH 4/4] um: Run UML in it's own session.
  2013-08-19  9:30   ` Richard W.M. Jones
@ 2013-08-19 20:23     ` Richard Weinberger
  2013-09-07 12:14     ` Richard W.M. Jones
  1 sibling, 0 replies; 10+ messages in thread
From: Richard Weinberger @ 2013-08-19 20:23 UTC (permalink / raw)
  To: Richard W.M. Jones; +Cc: user-mode-linux-devel

Am 19.08.2013 11:30, schrieb Richard W.M. Jones:
> On Sun, Aug 18, 2013 at 01:30:09PM +0200, Richard Weinberger wrote:
>> If UML is not run by a shell it can happen that UML
>> will kill unrelated proceses upon a fatal exit because
>> it issues a kill(0, ...).
>> To prevent such oddities we create a new session in main().
>>
>> Cc: rjones@redhat.com
>> Reported-by: Richard W.M. Jones <rjones@redhat.com>
>> Signed-off-by: Richard Weinberger <richard@nod.at>
> 
> I tested this using the "debug segv" test script that I previously
> posted on the user-mode-linux mailing list, and this problem is now
> fixed.  Therefore:
> 
> Tested-by: Richard W.M. Jones <rjones@redhat.com>
> 
> Thanks for these great fixes!

Thanks for testing. :-)
I'll add all patches to uml-next.git in a few days (maybe someone finds a bug).
Expect them in v3.12.

Thanks,
//richard


------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
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] 10+ messages in thread

* Re: [uml-devel] [PATCH 4/4] um: Run UML in it's own session.
  2013-08-19  9:30   ` Richard W.M. Jones
  2013-08-19 20:23     ` Richard Weinberger
@ 2013-09-07 12:14     ` Richard W.M. Jones
  2013-09-07 12:16       ` Richard Weinberger
  1 sibling, 1 reply; 10+ messages in thread
From: Richard W.M. Jones @ 2013-09-07 12:14 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: user-mode-linux-devel

On Mon, Aug 19, 2013 at 10:30:49AM +0100, Richard W.M. Jones wrote:
> On Sun, Aug 18, 2013 at 01:30:09PM +0200, Richard Weinberger wrote:
> > If UML is not run by a shell it can happen that UML
> > will kill unrelated proceses upon a fatal exit because
> > it issues a kill(0, ...).
> > To prevent such oddities we create a new session in main().
> > 
> > Cc: rjones@redhat.com
> > Reported-by: Richard W.M. Jones <rjones@redhat.com>
> > Signed-off-by: Richard Weinberger <richard@nod.at>
> 
> I tested this using the "debug segv" test script that I previously
> posted on the user-mode-linux mailing list, and this problem is now
> fixed.  Therefore:
> 
> Tested-by: Richard W.M. Jones <rjones@redhat.com>
> 
> Thanks for these great fixes!

I've been using these 4 patches rebased on top of successive Linux
HEAD's for nearly a month, and they work great.

But they don't seem to be going upstream, and they are necessary for
people who want to use the UML backend with libguestfs (which has
garnered some interest).  Anything I can do to help this happen?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
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] 10+ messages in thread

* Re: [uml-devel] [PATCH 4/4] um: Run UML in it's own session.
  2013-09-07 12:14     ` Richard W.M. Jones
@ 2013-09-07 12:16       ` Richard Weinberger
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Weinberger @ 2013-09-07 12:16 UTC (permalink / raw)
  To: Richard W.M. Jones; +Cc: user-mode-linux-devel

Am 07.09.2013 14:14, schrieb Richard W.M. Jones:
> On Mon, Aug 19, 2013 at 10:30:49AM +0100, Richard W.M. Jones wrote:
>> On Sun, Aug 18, 2013 at 01:30:09PM +0200, Richard Weinberger wrote:
>>> If UML is not run by a shell it can happen that UML
>>> will kill unrelated proceses upon a fatal exit because
>>> it issues a kill(0, ...).
>>> To prevent such oddities we create a new session in main().
>>>
>>> Cc: rjones@redhat.com
>>> Reported-by: Richard W.M. Jones <rjones@redhat.com>
>>> Signed-off-by: Richard Weinberger <richard@nod.at>
>>
>> I tested this using the "debug segv" test script that I previously
>> posted on the user-mode-linux mailing list, and this problem is now
>> fixed.  Therefore:
>>
>> Tested-by: Richard W.M. Jones <rjones@redhat.com>
>>
>> Thanks for these great fixes!
> 
> I've been using these 4 patches rebased on top of successive Linux
> HEAD's for nearly a month, and they work great.
> 
> But they don't seem to be going upstream, and they are necessary for
> people who want to use the UML backend with libguestfs (which has
> garnered some interest).  Anything I can do to help this happen?

Sure they are.
https://lkml.org/lkml/2013/9/7/52

Thanks,
//richard


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
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] 10+ messages in thread

end of thread, other threads:[~2013-09-07 12:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-18 11:30 [uml-devel] [PATCH 1/4] um: ubd: Add REQ_FLUSH suppport Richard Weinberger
2013-08-18 11:30 ` [uml-devel] [PATCH 2/4] um: ubd: Introduce submit_request() Richard Weinberger
2013-08-18 11:30 ` [uml-devel] [PATCH 3/4] um: Cleanup SIGTERM handling Richard Weinberger
2013-08-19  9:28   ` Richard W.M. Jones
2013-08-18 11:30 ` [uml-devel] [PATCH 4/4] um: Run UML in it's own session Richard Weinberger
2013-08-19  9:30   ` Richard W.M. Jones
2013-08-19 20:23     ` Richard Weinberger
2013-09-07 12:14     ` Richard W.M. Jones
2013-09-07 12:16       ` Richard Weinberger
2013-08-19  9:21 ` [uml-devel] [PATCH 1/4] um: ubd: Add REQ_FLUSH suppport Richard W.M. Jones

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.