[Devel] [PATCH rh7] ve: Add a ability to show ve.mount_opts

Maxim Patlasov mpatlasov at virtuozzo.com
Tue Jul 7 13:51:49 PDT 2015


Hi Kirill,

see please inline comment below...

On 07/06/2015 04:04 AM, Kirill Tkhai wrote:
> A user may want to see allowed mount options.
> This patch allows that.
>
> Signed-off-by: Kirill Tkhai <ktkhai at odin.com>
> ---
>   kernel/ve/ve.c |   82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 82 insertions(+)
>
> diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
> index 6496727..4cd1f8b 100644
> --- a/kernel/ve/ve.c
> +++ b/kernel/ve/ve.c
> @@ -929,6 +929,85 @@ static int ve_id_write(struct cgroup *cg, struct cftype *cft, u64 value)
>   	return err;
>   }
>   
> +static void *ve_mount_opts_start(struct seq_file *m, loff_t *ppos)
> +{
> +	struct ve_struct *ve = m->private;
> +	struct ve_devmnt *devmnt;
> +	loff_t pos = *ppos;
> +
> +	mutex_lock(&ve->devmnt_mutex);
> +	list_for_each_entry(devmnt, &ve->devmnt_list, link) {
> +		if (!pos--)
> +			return devmnt;
> +	}
> +	return NULL;
> +}
> +
> +static void *ve_mount_opts_next(struct seq_file *m, void *v, loff_t *ppos)
> +{
> +	struct ve_struct *ve = m->private;
> +	struct ve_devmnt *devmnt = v;
> +
> +	(*ppos)++;
> +	if (list_is_last(&devmnt->link, &ve->devmnt_list))
> +		return NULL;
> +	return list_entry(devmnt->link.next, struct ve_devmnt, link);
> +}
> +
> +static void ve_mount_opts_stop(struct seq_file *m, void *v)
> +{
> +	struct ve_struct *ve = m->private;
> +
> +	mutex_unlock(&ve->devmnt_mutex);
> +}
> +
> +static int ve_mount_opts_show(struct seq_file *m, void *v)
> +{
> +	struct ve_devmnt *devmnt = v;
> +	dev_t dev = devmnt->dev;
> +
> +	seq_printf(m, "0 %u:%u;1 %s;2 %s;\n", MAJOR(dev), MINOR(dev),
> +					      devmnt->hidden_options,
> +					      devmnt->allowed_options);

Why do we need to show hidden options to CT' user? He/she doesn't see 
".balloon" file, so it doesn't seem consistent to show "balloon_ino=N".

Thanks,
Maxim



More information about the Devel mailing list