linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] cgroup2: Always apply root flags on successful superblock obtainance
@ 2019-01-03 23:44 David Howells
  2019-01-03 23:44 ` [PATCH 2/5] kernfs: Provide a fill_super hook for the subclass filesystem David Howells
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: David Howells @ 2019-01-03 23:44 UTC (permalink / raw)
  To: viro; +Cc: Andrei Vagin, avagin, dhowells, linux-fsdevel

Always apply the v2 cgroup root flag settings after successfully obtaining
a superblock, both when the superblock is new and when an already extant
superblock is being shared.

Currently there's a bug in commit b3678086951a5 whereby the flags are only
changed if the superblock wasn't new.  The intention was originally to
effect the change for a new superblock by having kernfs_fill_super() call
back into the subclassing filesystem, but that never got completed.

On further reflection, it's possibly better not to do that so that we don't
have to revert the flag change if there's a later failure.

This patch is on top of Andrei Vagin's v6 cgroup refcount patch.

Fixes: b3678086951a ("kernfs, sysfs, cgroup, intel_rdt: Support fs_context")
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Andrei Vagin <avagin@gmail.com>
---

 kernel/cgroup/cgroup.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index a19f0fec9d82..2e5150412ae0 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -2044,12 +2044,9 @@ int cgroup_do_get_tree(struct fs_context *fc)
 		fc->root = nsdentry;
 	}
 
+	if (ctx->version == 2)
+		apply_cgroup_root_flags(ctx->flags);
 	ret = 0;
-	if (ctx->kfc.new_sb_created)
-		goto out_cgrp;
-	apply_cgroup_root_flags(ctx->flags);
-	return 0;
-
 out_cgrp:
 	return ret;
 }

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-01-05 16:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-03 23:44 [PATCH 1/5] cgroup2: Always apply root flags on successful superblock obtainance David Howells
2019-01-03 23:44 ` [PATCH 2/5] kernfs: Provide a fill_super hook for the subclass filesystem David Howells
2019-01-03 23:44 ` [PATCH 3/5] cgroup: Fix refcounting David Howells
2019-01-04  8:16   ` Andrei Vagin
2019-01-05  6:37   ` Al Viro
2019-01-05 16:05     ` Al Viro
2019-01-05  7:21   ` David Howells
2019-01-03 23:44 ` [PATCH 4/5] cgroup: refcount fixes David Howells
2019-01-03 23:44 ` [PATCH 5/5] percpu: Kill off PERCPU_REF_INIT_DEAD and percpu_ref_reinit() David Howells
2019-01-03 23:56 ` [PATCH 4/5] cgroup: refcount fixes David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).