From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Jeff Layton <jlayton@redhat.com>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH][RFC] nfsd/lockd: have locks_in_grace take a sb arg
Date: Wed, 11 Apr 2012 21:37:33 +0400 [thread overview]
Message-ID: <4F85C15D.5060408@parallels.com> (raw)
In-Reply-To: <20120411171919.GA29903@fieldses.org>
11.04.2012 21:19, J. Bruce Fields пишет:
> On Wed, Apr 11, 2012 at 05:08:46PM +0400, Stanislav Kinsbursky wrote:
>> 11.04.2012 15:48, Jeff Layton пишет:
>>>>>>> One thing that puzzles me at the moment. We have two namespaces to deal
>>>>>>> with -- the network and the mount namespace. With nfs client code,
>>>>>>> everything is keyed off of the net namespace. That's not really the
>>>>>>> case here since we have to deal with a local fs tree as well.
>>>>>>>
>>>>>>> When an nfsd running in a container receives an RPC, how does it
>>>>>>> determine what mount namespace it should do its operations in?
>>>>>>>
>>>>>>
>>>>>> We don't use mount namespaces, so that's why I wasn't thinking about it...
>>>>>> But if we have 2 types of namespaces, then we have to tie mount namesapce to
>>>>>> network. I.e we can get desired mount namespace from per-net NFSd data.
>>>>>>
>>>>>
>>>>> One thing that Bruce mentioned to me privately is that we could plan to
>>>>> use whatever mount namespace mountd is using within a particular net
>>>>> namespace. That makes some sense since mountd is the final arbiter of
>>>>> who gets access to what.
>>>>>
>>>>
>>>> Could you, please, give some examples? I don't get the idea.
>>>>
>>>
>>> When nfsd gets an RPC call, it needs to decide in what mount namespace
>>> to do the fs operations. How do we decide this?
>>>
>>> Bruce's thought was to look at what mount namespace rpc.mountd is using
>>> and use that, but now that I consider it, it's a bit of a chicken and
>>> egg problem really... nfsd talks to mountd via files in /proc/net/rpc/.
>>> In order to talk to the right mountd, might you need to know what mount
>>> namespace it's operating in?
>>>
>>
>> Not really... /proc itself depens on pid namespace. /proc/net
>> depends on current (!) network namespace. So we can't just lookup
>> for this dentry.
>>
>> But, in spite of nfsd works in initial (init_net and friends)
>> environment, we can get network namespace from RPC request. Having
>> this, we can easily get desired proc entry (proc_net_rpc in
>> sunrpc_net). So it looks like we can actually don't care about mount
>> namespaces - we have our own back door.
>
> OK, good, that's what I was hoping for. Then we call up to whatever
> mountd is running in our network namespace, and for path lookups it's
> whatever fs namespace that mountd is running in that's going to matter.
>
The problem here, is that mountd is running in pid namespace - not net.
What would happen, if we will have situation like below:
mountd A mountd B
pid_ns pid_ns
| |
mnt_ns mnt_ns
| |
----- net_ns ----
Is it possible, BTW?
It yes, that is such construction valid?
--
Best regards,
Stanislav Kinsbursky
next prev parent reply other threads:[~2012-04-11 17:37 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-03 12:14 [PATCH][RFC] nfsd/lockd: have locks_in_grace take a sb arg Jeff Layton
2012-04-09 23:18 ` J. Bruce Fields
2012-04-10 11:13 ` Jeff Layton
2012-04-10 13:18 ` J. Bruce Fields
2012-04-10 11:44 ` Stanislav Kinsbursky
2012-04-10 12:05 ` Jeff Layton
2012-04-10 12:18 ` Stanislav Kinsbursky
2012-04-10 12:16 ` Jeff Layton
2012-04-10 12:46 ` Stanislav Kinsbursky
2012-04-10 13:39 ` Jeff Layton
2012-04-10 14:52 ` Stanislav Kinsbursky
2012-04-10 18:45 ` Jeff Layton
2012-04-11 10:09 ` Stanislav Kinsbursky
2012-04-11 11:48 ` Jeff Layton
2012-04-11 13:08 ` Stanislav Kinsbursky
2012-04-11 17:19 ` J. Bruce Fields
2012-04-11 17:37 ` Stanislav Kinsbursky [this message]
2012-04-11 18:22 ` J. Bruce Fields
2012-04-11 19:24 ` Stanislav Kinsbursky
2012-04-11 22:17 ` J. Bruce Fields
2012-04-12 9:05 ` Stanislav Kinsbursky
2012-04-10 20:22 ` J. Bruce Fields
2012-04-11 10:34 ` Stanislav Kinsbursky
2012-04-11 17:20 ` J. Bruce Fields
2012-04-11 17:33 ` Stanislav Kinsbursky
2012-04-11 17:40 ` Stanislav Kinsbursky
2012-04-11 18:20 ` J. Bruce Fields
2012-04-11 19:39 ` Stanislav Kinsbursky
2012-04-11 19:54 ` J. Bruce Fields
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=4F85C15D.5060408@parallels.com \
--to=skinsbursky@parallels.com \
--cc=bfields@fieldses.org \
--cc=jlayton@redhat.com \
--cc=linux-nfs@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 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.