From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Paul Menage" Subject: Re: [patch 03/15] cgroup: dont call vfs_mkdir Date: Mon, 5 May 2008 10:22:37 -0700 Message-ID: <6599ad830805051022g24a07324g395b39b003751791@mail.gmail.com> References: <20080505095440.820370974@szeredi.hu> <20080505095511.217634550@szeredi.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: akpm@linux-foundation.org, hch@infradead.org, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: "Miklos Szeredi" Return-path: Received: from smtp-out.google.com ([216.239.33.17]:7170 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751412AbYEERWt (ORCPT ); Mon, 5 May 2008 13:22:49 -0400 Received: from zps35.corp.google.com (zps35.corp.google.com [172.25.146.35]) by smtp-out.google.com with ESMTP id m45HMdr0026105 for ; Mon, 5 May 2008 18:22:40 +0100 Received: from an-out-0708.google.com (ancc31.prod.google.com [10.100.29.31]) by zps35.corp.google.com with ESMTP id m45HMcYn010062 for ; Mon, 5 May 2008 10:22:39 -0700 Received: by an-out-0708.google.com with SMTP id c31so591906anc.40 for ; Mon, 05 May 2008 10:22:38 -0700 (PDT) In-Reply-To: <20080505095511.217634550@szeredi.hu> Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, May 5, 2008 at 2:54 AM, Miklos Szeredi wrote: > From: Miklos Szeredi > > cgroup_clone() calls vfs_mkdir() to create a directory in the cgroup > filesystem. Replace with explicit call to cgroup_mkdir() and > fsnotify_mkdir(). > > This is equivalent, except that the following functions are not called > before cgroup_mkdir(): > > - may_create() > - security_inode_mkdir() > - DQUOT_INIT() > > Permission to clone the cgroup has already been checked in > copy_namespaces() (requiring CAP_SYS_ADMIN). Additional file system > related capability checks are inappropriate and confusing. > > The quota check is unnecessary, as quotas don't make any sense for > this filesystem. > > Signed-off-by: Miklos Szeredi > CC: Paul Menage This looks like it behaves correctly, but I don't really have any view on whether the change is the right thing to do - I'll leave that to the VFS gurus. FWIW, I'd regard cgroup_clone() as being outside the filesystem rather than inside. It does have some knowledge of the cgroupfs internals, but it tries to leave as much as possible up to the real filesystem code. Paul