From mboxrd@z Thu Jan 1 00:00:00 1970 From: Valerie Aurora Subject: Re: [patch 03/10] apparmor: use task path helpers Date: Tue, 17 Aug 2010 18:59:41 -0400 Message-ID: <20100817225941.GM5556@shell> References: <20100817183729.613117146@kernel.dk> <20100817184120.622515715@kernel.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Al Viro , linux-fsdevel@vger.kernel.org To: Nick Piggin Return-path: Received: from mx1.redhat.com ([209.132.183.28]:29973 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751757Ab0HQW7p (ORCPT ); Tue, 17 Aug 2010 18:59:45 -0400 Content-Disposition: inline In-Reply-To: <20100817184120.622515715@kernel.dk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Aug 18, 2010 at 04:37:32AM +1000, Nick Piggin wrote: > apparmor: use task path helpers > > Signed-off-by: Nick Piggin > > --- > BTW, argh! dcache_lock! Why does everything have to invent its own reverse > path lookup crud and hide it away in its own code? Also, admire the rest of > this beautiful function. > > --- > security/apparmor/path.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > Index: linux-2.6/security/apparmor/path.c > =================================================================== > --- linux-2.6.orig/security/apparmor/path.c 2010-08-18 04:04:02.000000000 +1000 > +++ linux-2.6/security/apparmor/path.c 2010-08-18 04:04:29.000000000 +1000 > @@ -62,19 +62,14 @@ static int d_namespace_path(struct path > int deleted, connected; > int error = 0; > > - /* Get the root we want to resolve too */ > + /* Get the root we want to resolve too, released below */ > if (flags & PATH_CHROOT_REL) { > /* resolve paths relative to chroot */ > - read_lock(¤t->fs->lock); > - root = current->fs->root; > - /* released below */ > - path_get(&root); > - read_unlock(¤t->fs->lock); > + get_fs_root(current->fs, &root); > } else { > /* resolve paths relative to namespace */ > root.mnt = current->nsproxy->mnt_ns->root; > root.dentry = root.mnt->mnt_root; > - /* released below */ > path_get(&root); > } Gosh, maybe this VFS stuff isn't as hard as I thought! This one's easy to review too. :) Looks good. Reviewed-by: Valerie Aurora -VAL