From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: [PATCH] fs: move permission check back into __lookup_hash Date: Wed, 6 Oct 2010 10:47:47 +0200 Message-ID: <20101006084747.GC8093@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: viro@zeniv.linux.org.uk Return-path: Received: from verein.lst.de ([213.95.11.210]:44378 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758681Ab0JFIrs (ORCPT ); Wed, 6 Oct 2010 04:47:48 -0400 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: The caller that didn't need it is gone. Signed-off-by: Christoph Hellwig Index: linux-2.6/fs/namei.c =================================================================== --- linux-2.6.orig/fs/namei.c 2010-09-20 12:20:15.152444173 -0300 +++ linux-2.6/fs/namei.c 2010-09-20 12:23:48.532444189 -0300 @@ -1121,11 +1121,13 @@ int vfs_path_lookup(struct dentry *dentr static struct dentry *__lookup_hash(struct qstr *name, struct dentry *base, struct nameidata *nd) { + struct inode *inode = base->d_inode; struct dentry *dentry; - struct inode *inode; int err; - inode = base->d_inode; + err = exec_permission(inode); + if (err) + return ERR_PTR(err); /* * See if the low-level filesystem might want @@ -1161,11 +1159,6 @@ out: */ static struct dentry *lookup_hash(struct nameidata *nd) { - int err; - - err = exec_permission(nd->path.dentry->d_inode); - if (err) - return ERR_PTR(err); return __lookup_hash(&nd->last, nd->path.dentry, nd); } @@ -1213,9 +1206,6 @@ struct dentry *lookup_one_len(const char if (err) return ERR_PTR(err); - err = exec_permission(base->d_inode); - if (err) - return ERR_PTR(err); return __lookup_hash(&this, base, NULL); }