Skip to content

Commit

Permalink
fs: move permission check back into __lookup_hash
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Al Viro committed Oct 26, 2010
1 parent 72e5806 commit 81fca44
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1161,11 +1163,6 @@ static struct dentry *__lookup_hash(struct qstr *name,
*/
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);
}

Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 81fca44

Please sign in to comment.