From: "J. Bruce Fields" <bfields@fieldses.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Stanislav Kinsbursky <skinsbursky@parallels.com>,
akpm@linux-foundation.org, jlayton@redhat.com,
lucas.demarchi@profusion.mobi, rusty@rustcorp.com.au,
linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
bharrosh@panasas.com, devel@openvz.org
Subject: Re: [RFC PATCH] kmod: add ability to swap root in usermode helper
Date: Tue, 21 May 2013 11:35:31 -0400 [thread overview]
Message-ID: <20130521153531.GO14677@fieldses.org> (raw)
In-Reply-To: <20130521152836.GA13461@redhat.com>
On Tue, May 21, 2013 at 05:28:36PM +0200, Oleg Nesterov wrote:
> You know, I am puzzled. Everything looks so clear that I can't
> understand what I could miss.
>
> On 05/20, J. Bruce Fields wrote:
> >
> > On Mon, May 20, 2013 at 05:10:01PM +0200, Oleg Nesterov wrote:
> > > On 05/20, Stanislav Kinsbursky wrote:
> > > >
> > > OK, why nfs can't simply use this code
> > >
> > > static int umh_set_fs_root(struct subprocess_info *info, struct cred *new)
> > > {
> > > set_fs_root(current->fs, sub_info->data);
> > > return 0;
> > > }
> > >
> > > int call_usermodehelper_root(char *path, char **argv, char **envp, int wait,
> > > struct path *root)
> > > {
> > >
> > > struct subprocess_info *info;
> > >
> > > info = call_usermodehelper_setup(path, argv, envp, gfp_mask,
> > > umh_set_fs_root, NULL, root);
> > > if (info == NULL)
> > > return -ENOMEM;
> > > return call_usermodehelper_exec(info, wait);
> > > }
> >
> > Right, that's more or less what Stanislav proposed before:
> >
> > https://patchwork.kernel.org/patch/2449081/
> >
> > (though with an open-coded set_fs_root). Jeff and I asked him to try
> > this approach instead.
>
> And I still can't understand why you do not like this.
>
> > > ? Why do you want to add the new member, the new arguments, the new helpers?
> >
> > - It's simpler for callers to be able to say "run this help in
> > that namespace" in a single line. We expect there will be
> > more such callers, so the mild complication of the API seems
> > worth it for the convenience.
>
> So call_usermodehelper_root() above doesn't look as a simple API for you?
>
> Add it into kmod.c (or another place) and use it everywhere, why do
> insist we should complicate the generic code?
>
> What if someone wants to, say, change "nice" before running the helper?
> Do you think that we need yet another change which turns
> call_usermodehelper_setup_root() added by this patch into
> call_usermodehelper_setup_root_nice()? And another member in sub_info?
> And the "if (sub_info->nice)" check into ____call_usermodehelper() ?
>
> > - set_fs_root looks like something that shouldn't really be used
> > outside of a small number of well-known callers in core code.
>
> OK, so do not do this. Export the new helper.
You mean, export umh_set_fs_root() in the above?
That might be OK.
---b.
next prev parent reply other threads:[~2013-05-21 15:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-20 7:00 [RFC PATCH] kmod: add ability to swap root in usermode helper Stanislav Kinsbursky
2013-05-20 8:42 ` Jeff Layton
2013-05-20 8:56 ` Stanislav Kinsbursky
2013-05-20 13:57 ` Oleg Nesterov
2013-05-20 14:43 ` Stanislav Kinsbursky
2013-05-20 15:10 ` Oleg Nesterov
2013-05-20 21:24 ` J. Bruce Fields
2013-05-21 15:28 ` Oleg Nesterov
2013-05-21 15:35 ` J. Bruce Fields [this message]
2013-05-21 16:29 ` Oleg Nesterov
2013-05-22 6:00 ` Stanislav Kinsbursky
2013-05-21 5:50 ` Rusty Russell
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=20130521153531.GO14677@fieldses.org \
--to=bfields@fieldses.org \
--cc=akpm@linux-foundation.org \
--cc=bharrosh@panasas.com \
--cc=devel@openvz.org \
--cc=jlayton@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.demarchi@profusion.mobi \
--cc=oleg@redhat.com \
--cc=rusty@rustcorp.com.au \
--cc=skinsbursky@parallels.com \
--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