[Devel,RHEL7,COMMIT] ve: increase max length of ve.mount_opts string

Submitted by Konstantin Khorenko on June 27, 2017, 9:42 a.m.

Details

Message ID 201706270942.v5R9ginA027130@finist_cl7.x64_64.work.ct
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko June 27, 2017, 9:42 a.m.
The commit is pushed to "branch-rh7-3.10.0-514.16.1.vz7.32.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.16.1.vz7.32.11
------>
commit 9ab759a43e48d96cceb9b7884e3dae2a0bce820f
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
Date:   Tue Jun 27 13:42:44 2017 +0400

    ve: increase max length of ve.mount_opts string
    
    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(+)

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,