From: ebiederm@xmission.com (Eric W. Biederman)
To: "Björn Steinbrink" <B.Steinbrink@gmx.de>
Cc: herbert@13thfloor.at, akpm@osdl.org, viro@ftp.linux.org.uk,
linux-kernel@vger.kernel.org, torvalds@osdl.org
Subject: Re: kjournald keeps reference to namespace
Date: Sat, 18 Feb 2006 19:32:41 -0700 [thread overview]
Message-ID: <m1mzgom62e.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20060218171243.GA23640@atjola.homenet> ( =?iso-8859-1?q?Bj=F6rn_Steinbrink's_message_of?= "Sat, 18 Feb 2006 18:12:43 +0100")
Björn Steinbrink <B.Steinbrink@gmx.de> writes:
> On 2006.02.18 17:32:27 +0100, Björn Steinbrink wrote:
>> > 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.
>> > The following patch adds the namespace part.
>> >
>> > Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
>> > ---
>>
>> Oops, forgot the increment the namespace usage count...
>
> Ok, this time with the get_namespace wrapper, thanks to Eric Biederman
> for pointing that out to me.
Acked-by: Eric Biederman <ebiederm@xmission.com>
Note 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.
> ---
>
>
> diff -NurpP --minimal linux-2.6.16-rc4/kernel/exit.c
> linux-2.6.16-rc4-ns/kernel/exit.c
> --- linux-2.6.16-rc4/kernel/exit.c 2006-02-18 13:59:59.000000000 +0100
> +++ linux-2.6.16-rc4-ns/kernel/exit.c 2006-02-18 17:57:21.000000000 +0100
> @@ -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(¤t->files->count);
prev parent reply other threads:[~2006-02-19 2:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-18 1:35 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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1mzgom62e.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=B.Steinbrink@gmx.de \
--cc=akpm@osdl.org \
--cc=herbert@13thfloor.at \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
--cc=viro@ftp.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome