Netdev List
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue@us.ibm.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linux Containers <containers@lists.osdl.org>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] Update get_net_ns_by_pid
Date: Fri, 28 Sep 2007 18:13:54 -0500	[thread overview]
Message-ID: <20070928231354.GB7407@sergelap.austin.rr.com> (raw)
In-Reply-To: <m1k5qbfo1n.fsf@ebiederm.dsl.xmission.com>

Quoting Eric W. Biederman (ebiederm@xmission.com):
> 
> In the -mm tree the rules for access an nsproxy have changed,
> and in get_net_ns_by_pid we access the nsproxy, so update
> it to follow the new rules.
> 
> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>

Yup, looks right.

I assume Pavel's Acked-by would actually matter, but still

Acked-by: Serge Hallyn <serue@us.ibm.com>

thanks,
-serge

> ---
> 
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index 739fbad..1caba10 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -746,10 +746,10 @@ static struct net *get_net_ns_by_pid(pid_t pid)
>  	rcu_read_lock();
>  	tsk = find_task_by_pid(pid);
>  	if (tsk) {
> -		task_lock(tsk);
> -		if (tsk->nsproxy)
> -			net = get_net(tsk->nsproxy->net_ns);
> -		task_unlock(tsk);
> +		struct nsproxy *nsproxy;
> +		nsproxy = task_nsproxy(tsk);
> +		if (nsproxy)
> +			net = get_net(nsproxy->net_ns);
>  	}
>  	rcu_read_unlock();
>  	return net;
> _______________________________________________
> Containers mailing list
> Containers@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/containers

      reply	other threads:[~2007-09-28 23:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-28  3:48 [PATCH] Update get_net_ns_by_pid Eric W. Biederman
2007-09-28 23:13 ` Serge E. Hallyn [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=20070928231354.GB7407@sergelap.austin.rr.com \
    --to=serue@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=containers@lists.osdl.org \
    --cc=ebiederm@xmission.com \
    --cc=netdev@vger.kernel.org \
    /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