All of lore.kernel.org
 help / color / mirror / Atom feed
* kjournald keeps reference to namespace
@ 2006-02-18  1:35 Herbert Poetzl
  2006-02-18  1:54 ` Andrew Morton
  2006-02-18 13:36 ` Björn Steinbrink
  0 siblings, 2 replies; 10+ messages in thread
From: Herbert Poetzl @ 2006-02-18  1:35 UTC (permalink / raw)
  To: Andrew Morton, Al Viro; +Cc: Linux Kernel ML


Hi Folks!

when creating a private namespace (CLONE_NS) and
then mounting an ext3 filesystem, a new kernel
thread (kjournald) is created, which keeps a
reference to the namespace, which after the the
process exits, remains and blocks access to the
block device, as it is still bd_claim-ed.

this leaves a private namespace behind and a
block device which cannot be opened exclusively.
unmount is not an option, as the namespace is
not longer reachable.

this behaviour seems to be there since ever,
well since namespaces and kjournald exists :)

the following 'cruel' hack 'solves' this issue

best,
Herbert


--- fs/jbd/journal.c.orig	2006-01-03 17:29:56 +0100
+++ fs/jbd/journal.c	2006-02-18 02:23:21 +0100
@@ -33,6 +33,7 @@
 #include <linux/mm.h>
 #include <linux/suspend.h>
 #include <linux/pagemap.h>
+#include <linux/namespace.h>
 #include <asm/uaccess.h>
 #include <asm/page.h>
 #include <linux/proc_fs.h>
@@ -116,6 +117,13 @@ static int kjournald(void *arg)
 	struct timer_list timer;
 
 	daemonize("kjournald");
+	{
+		struct namespace *ns = current->namespace;
+
+		current->namespace = NULL;
+		put_namespace(ns);
+	}
+
 
 	/* Set up an interval timer which can be used to trigger a
            commit wakeup after the commit interval expires */


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

end of thread, other threads:[~2006-02-24 22:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-18  1:35 kjournald keeps reference to namespace Herbert Poetzl
2006-02-18  1:54 ` Andrew Morton
2006-02-18  3:30   ` Herbert Poetzl
2006-02-24 21:28     ` Paul Collins
2006-02-24 21:36       ` Andrew Morton
2006-02-24 22:01         ` Paul Collins
2006-02-18 13:36 ` Björn Steinbrink
2006-02-18 16:32   ` Björn Steinbrink
2006-02-18 17:12     ` Björn Steinbrink
2006-02-19  2:32       ` Eric W. Biederman

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.