[Devel,rh7,1/2] ve: increase max length of ve.mount_opts string

Submitted by Konstantin Khorenko on June 26, 2017, 11:51 a.m.

Details

Message ID 1498477877-3641-1-git-send-email-khorenko@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko June 26, 2017, 11:51 a.m.
Default max string length for cgroup file is
CGROUP_LOCAL_BUFFER_SIZE == 64

which is not enough for allow quota options for example:
echo "0 7:1;1 aaa;2 usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0;" > /sys/fs/cgroup/ve/100/ve.mount_opts
-bash: echo: write error: Argument list too long

So increase the max limit to 256 for now.

https://jira.sw.ru/browse/PSBM-40075

Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 kernel/ve/ve.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index 7cb47fa..0533d79 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -1039,6 +1039,7 @@  static int ve_mount_opts_release(struct inode *inode, struct file *file)
  * consisting of substrings separated by MNTOPT_DELIM.
  */
 #define MNTOPT_DELIM ';'
+#define MNTOPT_MAXLEN 256
 
 /*
  * Each substring has the form of "<type> <comma-separated-list-of-options>"
@@ -1418,6 +1419,7 @@  static struct cftype ve_cftypes[] = {
 	},
 	{
 		.name			= "mount_opts",
+		.max_write_len		= MNTOPT_MAXLEN,
 		.flags			= CFTYPE_NOT_ON_ROOT,
 		.open			= ve_mount_opts_open,
 		.read			= ve_mount_opts_read,

Comments

Kirill Tkhai June 26, 2017, 3:59 p.m.
On Mon, Jun 26, 2017 at 15:51, Konstantin Khorenko wrote:
> Default max string length for cgroup file is
> CGROUP_LOCAL_BUFFER_SIZE == 64
> 
> which is not enough for allow quota options for example:
> echo "0 7:1;1 aaa;2 usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0;" > /sys/fs/cgroup/ve/100/ve.mount_opts
> -bash: echo: write error: Argument list too long
> 
> So increase the max limit to 256 for now.
> 
> https://jira.sw.ru/browse/PSBM-40075
> 
> Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>

Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>

> ---
>  kernel/ve/ve.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
> index 7cb47fa..0533d79 100644
> --- a/kernel/ve/ve.c
> +++ b/kernel/ve/ve.c
> @@ -1039,6 +1039,7 @@ static int ve_mount_opts_release(struct inode *inode, struct file *file)
>   * consisting of substrings separated by MNTOPT_DELIM.
>   */
>  #define MNTOPT_DELIM ';'
> +#define MNTOPT_MAXLEN 256
>  
>  /*
>   * Each substring has the form of "<type> <comma-separated-list-of-options>"
> @@ -1418,6 +1419,7 @@ static struct cftype ve_cftypes[] = {
>  	},
>  	{
>  		.name			= "mount_opts",
> +		.max_write_len		= MNTOPT_MAXLEN,
>  		.flags			= CFTYPE_NOT_ON_ROOT,
>  		.open			= ve_mount_opts_open,
>  		.read			= ve_mount_opts_read,
> -- 
> 1.8.3.1
>