[PATCH] kjournald keeps reference to namespace
authorBjörn Steinbrink <B.Steinbrink@gmx.de>
Sat, 18 Feb 2006 17:12:43 +0000 (18:12 +0100)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 21 Feb 2006 04:27:38 +0000 (20:27 -0800)
In daemonize() a new thread gets cleaned up and 'merged' with init_task.
The current fs_struct is handled there, but not the current namespace.

This adds the namespace part.

[ Eric Biederman pointed out the namespace wrappers, and also notes that
  we can't ever count on using our parents namespace because we already
  have called exit_fs(), which is the only way to the namespace from a
  process. ]

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Acked-by: Eric Biederman <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/exit.c

index 93cee3671332352f8e4c0f7f9566d9086dd14354..531aadca553030543b643a0553f6144785d02bb5 100644 (file)
@@ -360,6 +360,9 @@ void daemonize(const char *name, ...)
        fs = init_task.fs;
        current->fs = fs;
        atomic_inc(&fs->count);
+       exit_namespace(current);
+       current->namespace = init_task.namespace;
+       get_namespace(current->namespace);
        exit_files(current);
        current->files = init_task.files;
        atomic_inc(&current->files->count);