diff options
author | Christoph Hellwig <hch@lst.de> | 2010-10-06 08:47:47 (GMT) |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-10-26 01:18:19 (GMT) |
commit | 81fca444001e5a41ab80ce8cf9a5734c00ec6546 (patch) | |
tree | 1d345a633c666686830a679a0a90c1f7c69470e6 | |
parent | 72e58063d63c5f0a7bf65312f1e3a5ed9bb5c2ff (diff) | |
download | linux-81fca444001e5a41ab80ce8cf9a5734c00ec6546.tar.xz |
fs: move permission check back into __lookup_hash
The caller that didn't need it is gone.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/namei.c | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -1121,11 +1121,13 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt, 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 +1163,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 +1210,6 @@ struct dentry *lookup_one_len(const char *name, struct dentry *base, int len) if (err) return ERR_PTR(err); - err = exec_permission(base->d_inode); - if (err) - return ERR_PTR(err); return __lookup_hash(&this, base, NULL); } |