All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org
Cc: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 01/16] cgroup: disallow xattr, release_agent and name if sane_behavior
Date: Sun,  9 Feb 2014 08:52:29 -0500	[thread overview]
Message-ID: <1391953964-22088-2-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1391953964-22088-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

Disallow more mount options if sane_behavior.  Note that xattr used to
generate warning.

While at it, simplify option check in cgroup_mount() and update
sane_behavior comment in cgroup.h.

Signed-off-by: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 include/linux/cgroup.h |  6 +++---
 kernel/cgroup.c        | 14 ++++----------
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 5f2c629..fa415a8 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -225,8 +225,8 @@ enum {
 	 *
 	 * The followings are the behaviors currently affected this flag.
 	 *
-	 * - Mount options "noprefix" and "clone_children" are disallowed.
-	 *   Also, cgroupfs file cgroup.clone_children is not created.
+	 * - Mount options "noprefix", "xattr", "clone_children",
+	 *   "release_agent" and "name" are disallowed.
 	 *
 	 * - When mounting an existing superblock, mount options should
 	 *   match.
@@ -244,7 +244,7 @@ enum {
 	 * - "release_agent" and "notify_on_release" are removed.
 	 *   Replacement notification mechanism will be implemented.
 	 *
-	 * - "xattr" mount option is deprecated.  kernfs always enables it.
+	 * - "cgroup.clone_children" is removed.
 	 *
 	 * - cpuset: tasks will be kept in empty cpusets when hotplug happens
 	 *   and take masks of ancestors with non-empty cpus/mems, instead of
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 4c53e90..47160ce 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1224,18 +1224,12 @@ static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts)
 	if (opts->flags & CGRP_ROOT_SANE_BEHAVIOR) {
 		pr_warning("cgroup: sane_behavior: this is still under development and its behaviors will change, proceed at your own risk\n");
 
-		if (opts->flags & CGRP_ROOT_NOPREFIX) {
-			pr_err("cgroup: sane_behavior: noprefix is not allowed\n");
+		if ((opts->flags & (CGRP_ROOT_NOPREFIX | CGRP_ROOT_XATTR)) ||
+		    opts->cpuset_clone_children || opts->release_agent ||
+		    opts->name) {
+			pr_err("cgroup: sane_behavior: noprefix, xattr, clone_children, release_agent and name are not allowed\n");
 			return -EINVAL;
 		}
-
-		if (opts->cpuset_clone_children) {
-			pr_err("cgroup: sane_behavior: clone_children is not allowed\n");
-			return -EINVAL;
-		}
-
-		if (opts->flags & CGRP_ROOT_XATTR)
-			pr_warning("cgroup: sane_behavior: xattr is always available, flag unnecessary\n");
 	}
 
 	/*
-- 
1.8.5.3

WARNING: multiple messages have this Message-ID (diff)
From: Tejun Heo <tj@kernel.org>
To: lizefan@huawei.com
Cc: containers@lists.linux-foundation.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>
Subject: [PATCH 01/16] cgroup: disallow xattr, release_agent and name if sane_behavior
Date: Sun,  9 Feb 2014 08:52:29 -0500	[thread overview]
Message-ID: <1391953964-22088-2-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1391953964-22088-1-git-send-email-tj@kernel.org>

Disallow more mount options if sane_behavior.  Note that xattr used to
generate warning.

While at it, simplify option check in cgroup_mount() and update
sane_behavior comment in cgroup.h.

Signed-off-by: Tejun Heo <tj@kernel.org>
---
 include/linux/cgroup.h |  6 +++---
 kernel/cgroup.c        | 14 ++++----------
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 5f2c629..fa415a8 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -225,8 +225,8 @@ enum {
 	 *
 	 * The followings are the behaviors currently affected this flag.
 	 *
-	 * - Mount options "noprefix" and "clone_children" are disallowed.
-	 *   Also, cgroupfs file cgroup.clone_children is not created.
+	 * - Mount options "noprefix", "xattr", "clone_children",
+	 *   "release_agent" and "name" are disallowed.
 	 *
 	 * - When mounting an existing superblock, mount options should
 	 *   match.
@@ -244,7 +244,7 @@ enum {
 	 * - "release_agent" and "notify_on_release" are removed.
 	 *   Replacement notification mechanism will be implemented.
 	 *
-	 * - "xattr" mount option is deprecated.  kernfs always enables it.
+	 * - "cgroup.clone_children" is removed.
 	 *
 	 * - cpuset: tasks will be kept in empty cpusets when hotplug happens
 	 *   and take masks of ancestors with non-empty cpus/mems, instead of
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 4c53e90..47160ce 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1224,18 +1224,12 @@ static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts)
 	if (opts->flags & CGRP_ROOT_SANE_BEHAVIOR) {
 		pr_warning("cgroup: sane_behavior: this is still under development and its behaviors will change, proceed at your own risk\n");
 
-		if (opts->flags & CGRP_ROOT_NOPREFIX) {
-			pr_err("cgroup: sane_behavior: noprefix is not allowed\n");
+		if ((opts->flags & (CGRP_ROOT_NOPREFIX | CGRP_ROOT_XATTR)) ||
+		    opts->cpuset_clone_children || opts->release_agent ||
+		    opts->name) {
+			pr_err("cgroup: sane_behavior: noprefix, xattr, clone_children, release_agent and name are not allowed\n");
 			return -EINVAL;
 		}
-
-		if (opts->cpuset_clone_children) {
-			pr_err("cgroup: sane_behavior: clone_children is not allowed\n");
-			return -EINVAL;
-		}
-
-		if (opts->flags & CGRP_ROOT_XATTR)
-			pr_warning("cgroup: sane_behavior: xattr is always available, flag unnecessary\n");
 	}
 
 	/*
-- 
1.8.5.3


  parent reply	other threads:[~2014-02-09 13:52 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-09 13:52 [PATCHSET cgroup/for-3.15] cgroup: more cleanups Tejun Heo
2014-02-09 13:52 ` Tejun Heo
     [not found] ` <1391953964-22088-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-02-09 13:52   ` Tejun Heo [this message]
2014-02-09 13:52     ` [PATCH 01/16] cgroup: disallow xattr, release_agent and name if sane_behavior Tejun Heo
2014-02-09 13:52   ` [PATCH 02/16] cgroup: drop CGRP_ROOT_SUBSYS_BOUND Tejun Heo
2014-02-09 13:52     ` Tejun Heo
2014-02-09 13:52   ` [PATCH 03/16] cgroup: enable task_cg_lists on the first cgroup mount Tejun Heo
2014-02-09 13:52     ` Tejun Heo
2014-02-09 13:52   ` [PATCH 04/16] cgroup: relocate cgroup_enable_task_cg_lists() Tejun Heo
2014-02-09 13:52     ` Tejun Heo
2014-02-09 13:52   ` [PATCH 05/16] cgroup: implement cgroup_has_tasks() and unexport cgroup_task_count() Tejun Heo
2014-02-09 13:52   ` [PATCH 06/16] cgroup: reimplement cgroup_transfer_tasks() without using css_scan_tasks() Tejun Heo
2014-02-09 13:52     ` Tejun Heo
2014-02-09 13:52   ` [PATCH 07/16] cgroup: make css_set_lock a rwsem and rename it to css_set_rwsem Tejun Heo
2014-02-09 13:52     ` Tejun Heo
2014-02-09 13:52   ` [PATCH 08/16] cpuset: use css_task_iter_start/next/end() instead of css_scan_tasks() Tejun Heo
2014-02-09 13:52     ` Tejun Heo
2014-02-09 13:52   ` [PATCH 09/16] cgroup: remove css_scan_tasks() Tejun Heo
2014-02-09 13:52     ` Tejun Heo
     [not found]     ` <1391953964-22088-10-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-02-13  2:01       ` Li Zefan
2014-02-13  2:01         ` Li Zefan
2014-02-09 13:52   ` [PATCH 10/16] cgroup: separate out put_css_set_locked() and remove put_css_set_taskexit() Tejun Heo
2014-02-09 13:52     ` Tejun Heo
2014-02-09 13:52   ` [PATCH 11/16] cgroup: move css_set_rwsem locking outside of cgroup_task_migrate() Tejun Heo
2014-02-09 13:52   ` [PATCH 12/16] cgroup: drop @skip_css from cgroup_taskset_for_each() Tejun Heo
2014-02-09 13:52     ` Tejun Heo
2014-02-09 13:52   ` [PATCH 13/16] cpuset: don't use cgroup_taskset_cur_css() Tejun Heo
2014-02-09 13:52   ` [PATCH 14/16] cgroup: remove cgroup_taskset_cur_css() and cgroup_taskset_size() Tejun Heo
2014-02-09 13:52   ` [PATCH 15/16] cgroup: cosmetic updates to cgroup_attach_task() Tejun Heo
2014-02-09 13:52   ` [PATCH 16/16] cgroup: unexport functions Tejun Heo
2014-02-13  2:01   ` [PATCHSET cgroup/for-3.15] cgroup: more cleanups Li Zefan
2014-02-13  2:01     ` Li Zefan
2014-02-13 11:59   ` Tejun Heo
2014-02-13 11:59     ` Tejun Heo
2014-02-09 13:52 ` [PATCH 05/16] cgroup: implement cgroup_has_tasks() and unexport cgroup_task_count() Tejun Heo
     [not found]   ` <1391953964-22088-6-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-02-10 12:36     ` Michal Hocko
2014-02-10 12:36     ` Michal Hocko
2014-02-10 12:36       ` Michal Hocko
2014-02-09 13:52 ` [PATCH 11/16] cgroup: move css_set_rwsem locking outside of cgroup_task_migrate() Tejun Heo
2014-02-09 13:52 ` [PATCH 13/16] cpuset: don't use cgroup_taskset_cur_css() Tejun Heo
2014-02-09 13:52 ` [PATCH 14/16] cgroup: remove cgroup_taskset_cur_css() and cgroup_taskset_size() Tejun Heo
2014-02-09 13:52 ` [PATCH 15/16] cgroup: cosmetic updates to cgroup_attach_task() Tejun Heo
     [not found]   ` <1391953964-22088-16-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-02-10 23:06     ` [PATCH v2 " Tejun Heo
2014-02-10 23:06       ` Tejun Heo
2014-02-10 23:06     ` Tejun Heo
2014-02-09 13:52 ` [PATCH 16/16] cgroup: unexport functions Tejun Heo

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=1391953964-22088-2-git-send-email-tj@kernel.org \
    --to=tj-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.