Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2395366imm; Thu, 21 Jun 2018 11:49:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIC1OdfFMLYF7S6b0qgqnOpmKYvN4nhd+3F6zn3OZF3JDHkn9c3Avx+FMTAU2HMNZDPYVtc X-Received: by 2002:a63:24c4:: with SMTP id k187-v6mr23417539pgk.434.1529606950763; Thu, 21 Jun 2018 11:49:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529606950; cv=none; d=google.com; s=arc-20160816; b=CdgV/I1zpXlJe8/NhpPqPuSA63U/8Rd1Z0Tf3DbFZt4sgK7Rfv11i8jdT223K9WjV4 40QMGAnZhTl3zKpFKhl5eXvA0IIMVIg1N9tolVutdb1oc/zF+/H6zgZp20AxP8gFce+z 0Qs29hSmcqKvrtbHMyQE0Km5pV0PrqJatQ/VYiFZZwOaXorzKlDYeoXfa8xWPQ+n78xp VZ29E8FPAOqAqcNp5R1N5ML/YY3CyLyXM4N5JML9h2hoD/399K5f5mSkGjUNkcgdXcR2 VCi2K7zvCfRCaB4NSHSTKcdead7UlAMyssPiMjqzJnEexIe+KOJsxAC7ReP1hhJiaUjw CrRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=JnMB7DzZD9TTO4EGJaihHqCsySCb76BtLdYQbXLF5ow=; b=dOG/iKnRrAB5e1HYOx6fqW7Zl3ZqjJH/gLsaEvEVzhJoT4JhbOEpglhHobXIfdoZVN OD9u5jSAmvTPBr4FQ9sWlXgJMQfokAgmBTrkuneCXMcrO7lekutKOSBjrnrCATQMVhh3 acL3aMtGAdGKbZr1SZnm0zw/GpuPwW2q2Lh4hUn34uSb/BMeAw0Cyl54fDxvuMWBYflG 6d4vPyLGjDqd8CpOTYy99E7XklYrmxp3hTiDvbulsFCTailt+t8QRwQtnONDMBQMrx9J EXNnc/dYWU1hHZrvwr6ATyJUjFMcOyp6ezwzwWPdiL7QZDZXR/ZrihfJDoReixS2K+H5 0IEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=bmTP0+Wn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p16-v6si5115735pff.356.2018.06.21.11.48.55; Thu, 21 Jun 2018 11:49:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=bmTP0+Wn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933047AbeFUSsO (ORCPT + 99 others); Thu, 21 Jun 2018 14:48:14 -0400 Received: from mail-ve1eur01on0091.outbound.protection.outlook.com ([104.47.1.91]:34272 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932719AbeFUSsM (ORCPT ); Thu, 21 Jun 2018 14:48:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JnMB7DzZD9TTO4EGJaihHqCsySCb76BtLdYQbXLF5ow=; b=bmTP0+Wnhe4QQiWnz3fQGlOe0GlLXhsKas2wYvL6RcUCIFjYpvZY9IJxJqqmpllK/7nUVqNbCqrpku6rAmG8fBxPVzcWUY9mFGVc+DxL5yEEVS2l9/3ytK+owpcILcaYPL464qNd1Vy88EKE9yqUdrCM6UTpikojc8qBSXm7nKQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=avagin@virtuozzo.com; Received: from outlook.office365.com (4.16.175.162) by DB7PR08MB3257.eurprd08.prod.outlook.com (2603:10a6:5:1f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.19; Thu, 21 Jun 2018 18:48:07 +0000 Date: Thu, 21 Jun 2018 11:47:55 -0700 From: Andrei Vagin To: David Howells Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Tejun Heo Subject: Re: [16/32] kernfs, sysfs, cgroup, intel_rdt: Support fs_context [ver #8] Message-ID: <20180621184754.GB21326@outlook.office365.com> References: <152720682792.9073.14747437198191460035.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <152720682792.9073.14747437198191460035.stgit@warthog.procyon.org.uk> User-Agent: Mutt/1.9.3 (2018-01-21) X-Originating-IP: [4.16.175.162] X-ClientProxiedBy: MWHPR11CA0002.namprd11.prod.outlook.com (2603:10b6:301:1::12) To DB7PR08MB3257.eurprd08.prod.outlook.com (2603:10a6:5:1f::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 073f79ea-8b66-431f-5b2a-08d5d7a7886e X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060)(7193020);SRVR:DB7PR08MB3257; X-Micro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3N/2RP5MeXnPvqqQiAevG7vBpxXVVxWAx3aU1ACKmI3+Uwobup9OjCo2QUsJ5fbKib2R18UtQ54fZsxLkotk+HWPJQaR9XNli9cNqKSRth7hKhcGMsB1NE3HWeCwK3GSed0GTjWlcvAKOpjNiADyUQWTavKgUmRMQFbl74398cjc3JfO4J2o0enexghXc0Fu1rYNN63seDkcTFJ5Q71PKG0SPKgSTTxXDg1OHYpuEJEVX2lcEwmPCAHweE49mNYQxeBIeZZLejwbM1KbTG7kD79/+ZaXPm/rhpsfpuVuFrtm8n0jWIDwdYKZUVjNc5Y5dL1+9+Pn/LGVgVB5udj0JALWkE/LtShngRjFhKP2lAipS0EadKF+hQzo;4:s0EX6S49/1GN7vp8r+NMWpAd8Ie65sza38KpoJoFTWgeB9Cmbwk+RPFrjBAZwXskXQo2iFnlEwRnPUryBWAkmUStm/SgVPpXd8OBVz4BPA2rI0sWMmzRxhs4cZyx5nYGBE0hfe9FIkt/lYz+WIEh8We6JYBo6mJyUTIh5D6K6gBjKHgT2hRd2fukS/sJAGB6ks1tubpiDXOYpk5pSkmPHhhYlYxoD95vXfY9UpZAIZrUUThLNcSvBmUA31rb5cI6Jsf0e7como4DEkQHaMva2OJQyzOgumnvU8qlvcuT/fyobv82Ww1aJpDxk8LVCv7H X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(251416522907027); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:DB7PR08MB3257;BCL:0;PCL:0;RULEID:;SRVR:DB7PR08MB3257; X-Forefront-PRVS: 07106EF9B9 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(39380400002)(396003)(346002)(366004)(39850400004)(376002)(199004)(189003)(105586002)(2906002)(486006)(476003)(50466002)(66066001)(956004)(966005)(25786009)(478600001)(6666003)(5660300001)(6916009)(4326008)(33656002)(69596002)(53416004)(47776003)(6306002)(55016002)(106356001)(97736004)(9686003)(23686003)(1076002)(446003)(11346002)(6116002)(68736007)(53936002)(6246003)(3846002)(81156014)(229853002)(8676002)(81166006)(86362001)(52116002)(386003)(6506007)(16526019)(7736002)(7696005)(76176011)(305945005)(26005)(8936002)(58126008)(316002)(575784001)(16586007)(37156001)(186003)(18370500001)(21314002);DIR:OUT;SFP:1102;SCL:1;SRVR:DB7PR08MB3257;H:outlook.office365.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?koi8-r?Q?1;DB7PR08MB3257;23:UfYSUczik9Lci6vQUqcc1ey4cAJQ2yw0fdsZeArUiqy?= =?koi8-r?Q?wIQvsw0npyHHQwFizaSHUmkkwka5NDyT3KErCQyhub5Iy9ZmyC0idoBV8YpIvr?= =?koi8-r?Q?tO9OOufpslLK1pby8alYZRtVqxe3QAcn6tzinTJob7SS64nMgA5RISFJK1KjMH?= =?koi8-r?Q?0qKFNY2/q5JO+pX757zEsaN9jykzjuS+rTLM8jR54GGXjO5fCoNvpFVKqEClSu?= =?koi8-r?Q?90rcCOulJufPlVbpvjVMkflBlNfbkJNEoTtremNletDJLbWEYMYDKMF1kQjqEm?= =?koi8-r?Q?RS/2sz7g9n4gSopnk21up0SitWlauAN4Vui58lkqX7kKXuXiXN2n9aAPvzCQNE?= =?koi8-r?Q?VZj+ct26CQCycrZOg9bGwVborTClGH91BFWjUAjgmDiyp1e2I2FYWSxLAtWhf2?= =?koi8-r?Q?9EzvzRvX7OY7Xu/jQMQ6T2Idp7qE5OOH4ZeGppm2io1bzlzfDAS35IP93ICYUd?= =?koi8-r?Q?lcfjpv+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L5YNL8z8XripLs2rVdAcNaJ8LI=;24:8myNAudgB0OPdal1acRqycrJwcbA4jt9oEuDUWdgmnbKzhintxYGulgSAfdF2H8WWMxCmHeTNHGyfWVnEPz14FOzhZ+QnyqkuFWRoNFBhIo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DB7PR08MB3257;7:08GII1WFMhrXBTeV9bpKXmmPekycq4w1HnqX7FaSscrAvEWbxk11wsqnLE9YcVf9IWo1eG9ecDPdITTBbj7blX0vRHbLvyY8tvOeV2bdBZwu3iHsPm9O5fcaV9sG+PM7DbF/5EgKGBwwvxsbWAejzU9a9GXd1SXbjTiTwIBJkupz8o/fqgpvsEYpH5jUrMFANhOmZhaVMlgvWbT59qSm5KQggug0/tjMsq1T6WGRL5fLU02Wl0AQ8lpZ0CQuQkz/;20:s0/ekCMdCfl7N71pyxbyXGKNjrfIKQq3rrYpDdy2plkeeeuaYMw9/BR4jFYxG6r3IH16u2mK9797lGvXqFxpsn0QbNg7gKFwpWrn+iZ1eMn2y31tJHT0Fh66S7kFzEmrbbnMIC6U/K70dnsBklcJwJiZ60k8vGMuejLFGYY2Mq4= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2018 18:48:07.8077 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 073f79ea-8b66-431f-5b2a-08d5d7a7886e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3257 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 25, 2018 at 01:07:08AM +0100, David Howells wrote: ... > @@ -1972,57 +1957,51 @@ int cgroup_setup_root(struct cgroup_root *root, u16 ss_mask, int ref_flags) > return ret; > } > > -struct dentry *cgroup_do_mount(struct file_system_type *fs_type, int flags, > - struct cgroup_root *root, unsigned long magic, > - struct cgroup_namespace *ns) > +int cgroup_do_get_tree(struct fs_context *fc) > { > - struct dentry *dentry; > - bool new_sb; > + struct cgroup_fs_context *ctx = fc->fs_private; > + int ret; > + > + ctx->kfc.root = ctx->root->kf_root; [root@fc24 ~]# mount -t cgroup -o none,name=zdtmtst xxx /mnt/test [root@fc24 ~]# mkdir /mnt/test/holder [root@fc24 ~]# umount /mnt/test [root@fc24 ~]# mount -t cgroup -o none,name=zdtmtst xxx /mnt/test Killed ctx->root can be NULL here [ 93.719897] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 [ 93.720097] PGD 80000002115f5067 P4D 80000002115f5067 PUD 1ef421067 PMD 0 [ 93.720179] Oops: 0000 [#1] SMP PTI [ 93.720257] CPU: 1 PID: 13843 Comm: cgroup04 Not tainted 4.18.0-rc1-next-20180621+ #1 [ 93.720342] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 93.720432] RIP: 0010:cgroup_do_get_tree+0x1b/0xf0 [ 93.720515] Code: 00 00 02 5b 5d c3 66 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 54 55 49 89 fc 53 48 83 ec 08 48 8b 9f 90 00 00 00 48 8b 43 20 <48> 8b 00 48 89 03 e8 8a cc 1e 00 85 c0 0f 88 97 00 00 00 48 81 7b [ 93.720655] RSP: 0018:ffffb07941b03df8 EFLAGS: 00010292 [ 93.720740] RAX: 0000000000000000 RBX: ffff9ba3527da300 RCX: 0000000000000000 [ 93.720819] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff9ba34d47b400 [ 93.720897] RBP: ffffb07941b03e58 R08: 0000000000000000 R09: 0000000000000002 [ 93.720975] R10: 0000000000000000 R11: 4aee8a3cb0beb9ec R12: ffff9ba34d47b400 [ 93.721053] R13: ffff9ba351518000 R14: ffffffff961705d4 R15: ffff9ba35143f000 [ 93.721131] FS: 000015418d893740(0000) GS:ffff9ba35fd00000(0000) knlGS:0000000000000000 [ 93.721233] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 93.721336] CR2: 0000000000000000 CR3: 00000001c4658004 CR4: 00000000001606e0 [ 93.721421] Call Trace: [ 93.721508] cgroup1_get_tree+0x57c/0x640 [ 93.721587] vfs_get_tree+0x6e/0x180 [ 93.721665] do_mount+0x76b/0xa80 [ 93.721753] ksys_mount+0x80/0xd0 [ 93.721831] __x64_sys_mount+0x21/0x30 [ 93.721908] do_syscall_64+0x60/0x1b0 [ 93.721987] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 93.722065] RIP: 0033:0x15418d3bc85a I think we need something like this: diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c index e12c0a91b8a4..b1340bd5f5fc 100644 --- a/kernel/cgroup/cgroup-v1.c +++ b/kernel/cgroup/cgroup-v1.c @@ -1192,6 +1192,7 @@ int cgroup1_get_tree(struct fs_context *fc) } ret = 0; + ctx->root = root; goto out_unlock; } @@ -1241,6 +1242,7 @@ int cgroup1_get_tree(struct fs_context *fc) percpu_ref_reinit(&root->cgrp.self.refcnt); mutex_unlock(&cgroup_mutex); } + cgroup_get(&root->cgrp); /* * If @pinned_sb, we're reusing an existing root and holding an https://travis-ci.org/avagin/linux/jobs/394887987 > > - dentry = kernfs_mount(fs_type, flags, root->kf_root, magic, &new_sb); > + ret = kernfs_get_tree(fc); > + if (ret < 0) > + goto out_cgrp; > > /* > * In non-init cgroup namespace, instead of root cgroup's dentry, > * we return the dentry corresponding to the cgroupns->root_cgrp. > */ > - if (!IS_ERR(dentry) && ns != &init_cgroup_ns) {