[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130522160353.GB16571@redhat.com>
Date: Wed, 22 May 2013 18:03:53 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Stanislav Kinsbursky <skinsbursky@...allels.com>
Cc: viro@...iv.linux.org.uk, serge.hallyn@...onical.com,
jlayton@...hat.com, lucas.demarchi@...fusion.mobi,
rusty@...tcorp.com.au, linux-kernel@...r.kernel.org,
bfields@...ldses.org, ebiederm@...ssion.com, bharrosh@...asas.com,
linux-fsdevel@...r.kernel.org, akpm@...ux-foundation.org,
devel@...nvz.org
Subject: Re: [RFC PATCH] fs: call_usermodehelper_root helper introduced
On 05/22, Stanislav Kinsbursky wrote:
>
> +static int umh_set_fs_root(struct subprocess_info *info, struct cred *new)
> +{
> + set_fs_root(current->fs, info->data);
> + return 0;
> +}
> +
> +/*
> + * Call a usermode helper with a specific fs root.
> + *
> + * The caller must hold extra reference to it otherwise, because it will be
> + * put on usermodehelper thread exit.
> + */
> +int call_usermodehelper_root(char *path, char **argv, char **envp,
> + struct path *root, int wait)
> +{
> + struct subprocess_info *info;
> + gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL;
> +
> + 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);
> +}
> +EXPORT_SYMBOL(call_usermodehelper_root);
Of course, I can't ack the placement (and yes, it was me who argued
that kmod.c is probably not the best place), but the patch looks fine.
I am not sure the new helper actually needs "int wait" but this matches
call_usermodehelper().
For what it's worth:
Reviewed-by: Oleg Nesterov <oleg@...hat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists