From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
"Myklebust, Trond" <Trond.Myklebust@netapp.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devel@openvz.org" <devel@openvz.org>
Subject: Re: [PATCH v3] SUNRPC: set desired file system root before connecting local transports
Date: Wed, 10 Oct 2012 09:09:24 +0400 [thread overview]
Message-ID: <50750304.2000007@parallels.com> (raw)
In-Reply-To: <87obkbytks.fsf@xmission.com>
10.10.2012 06:00, Eric W. Biederman пишет:
> ebiederm@xmission.com (Eric W. Biederman) writes:
>
>> "J. Bruce Fields" <bfields@fieldses.org> writes:
>>
>>> On Tue, Oct 09, 2012 at 01:20:48PM -0700, Eric W. Biederman wrote:
>>>> "Myklebust, Trond" <Trond.Myklebust@netapp.com> writes:
>>>>
>>>>> On Tue, 2012-10-09 at 15:35 -0400, J. Bruce Fields wrote:
>>>>>> Cc'ing Eric since I seem to recall he suggested doing it this way?
>>>> Yes. On second look setting fs->root won't work. We need to change fs.
>>>> The problem is that by default all kernel threads share fs so changing
>>>> fs->root will have non-local consequences.
>>> Oh, huh. And we can't "unshare" it somehow?
>> I don't fully understand how nfs uses kernel threads and work queues.
>> My general understanding is work queues reuse their kernel threads
>> between different users. So it is mostly a don't pollute your
>> environment thing. If there was a dedicated kernel thread for each
>> environment this would be trivial.
>>
>> What I was suggesting here is changing task->fs instead of
>> task->fs.root. That should just require task_lock().
>>
>>> Or, previously you suggested:
>>>
>>> - introduce sockaddr_fd that can be applied to AF_UNIX sockets,
>>> and teach unix_bind and unix_connect how to deal with a second
>>> type of sockaddr, AT_FD:
>>> struct sockaddr_fd { short fd_family; short pad; int fd; }
>>>
>>> - introduce sockaddr_unix_at that takes a directory file
>>> descriptor as well as a unix path, and teach unix_bind and
>>> unix_connect to deal with a second sockaddr type, AF_UNIX_AT:
>>> struct sockaddr_unix_at { short family; short pad; int dfd; char path[102]; }
>>>
>>> Any other options?
>> I am still half hoping we don't have to change the userspace API/ABI.
>> There is sanity checking on that path that no one seems interested in to
>> solve this problem.
> There is a good option if we are up to userspace ABI extensions.
>
> Implement open(2) on unix domain sockets. Where open(2) would
> essentially equal connect(2) on unix domain sockets.
>
> With an open(2) implementation we could use file_open_path and the
> implementation should be pretty straight forward and maintainable.
> So implementing open(2) looks like a good alternative implementation
> route.
This requires patching of vfs layer as well. I don't want to say, that
the idea is not good. But it requires much more time to implement and test.
And this patch addresses the problem, which exist already and would be
great to fix it as soon as possible.
So, probably, implementing open for unix sockets is the next and more
generic step.
Thanks.
> Eric
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-10-10 5:09 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-08 10:56 [PATCH v3] SUNRPC: set desired file system root before connecting local transports Stanislav Kinsbursky
2012-10-09 19:35 ` J. Bruce Fields
2012-10-09 19:49 ` Myklebust, Trond
2012-10-09 20:20 ` Eric W. Biederman
2012-10-09 22:31 ` J. Bruce Fields
2012-10-09 22:47 ` Eric W. Biederman
2012-10-10 1:23 ` J. Bruce Fields
2012-10-10 10:32 ` Stanislav Kinsbursky
2012-10-26 17:52 ` J. Bruce Fields
2012-10-10 2:00 ` Eric W. Biederman
2012-10-10 5:09 ` Stanislav Kinsbursky [this message]
2012-10-10 5:03 ` Stanislav Kinsbursky
2012-11-06 10:14 ` Stanislav Kinsbursky
2012-11-06 12:06 ` J. Bruce Fields
2012-11-06 12:11 ` Stanislav Kinsbursky
2012-11-06 13:05 ` J. Bruce Fields
2012-11-06 12:40 ` Christoph Hellwig
2012-11-06 13:07 ` J. Bruce Fields
2012-11-06 13:10 ` Christoph Hellwig
2012-11-06 13:36 ` J. Bruce Fields
2012-11-07 18:33 ` J. Bruce Fields
2012-11-12 8:37 ` Stanislav Kinsbursky
2012-11-14 21:01 ` J. Bruce Fields
2012-11-14 21:36 ` Myklebust, Trond
2012-11-14 21:42 ` J. Bruce Fields
2012-11-14 21:51 ` Myklebust, Trond
2012-11-14 21:54 ` J. Bruce Fields
2012-11-15 6:14 ` Eric W. Biederman
2012-11-15 13:34 ` Myklebust, Trond
2012-11-15 18:58 ` J. Bruce Fields
2012-11-15 8:35 ` Stanislav Kinsbursky
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=50750304.2000007@parallels.com \
--to=skinsbursky@parallels.com \
--cc=Trond.Myklebust@netapp.com \
--cc=bfields@fieldses.org \
--cc=devel@openvz.org \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=viro@zeniv.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;
as well as URLs for NNTP newsgroup(s).