use can_lookup() instead of direct checks of ->i_op->lookup
a couple of places got missed back when Linus has introduced that one... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
8aac62706a
commit
0525290119
1 changed files with 2 additions and 2 deletions
|
@ -1976,7 +1976,7 @@ static int path_lookupat(int dfd, const char *name,
|
||||||
err = complete_walk(nd);
|
err = complete_walk(nd);
|
||||||
|
|
||||||
if (!err && nd->flags & LOOKUP_DIRECTORY) {
|
if (!err && nd->flags & LOOKUP_DIRECTORY) {
|
||||||
if (!nd->inode->i_op->lookup) {
|
if (!can_lookup(nd->inode)) {
|
||||||
path_put(&nd->path);
|
path_put(&nd->path);
|
||||||
err = -ENOTDIR;
|
err = -ENOTDIR;
|
||||||
}
|
}
|
||||||
|
@ -2850,7 +2850,7 @@ finish_lookup:
|
||||||
if ((open_flag & O_CREAT) && S_ISDIR(nd->inode->i_mode))
|
if ((open_flag & O_CREAT) && S_ISDIR(nd->inode->i_mode))
|
||||||
goto out;
|
goto out;
|
||||||
error = -ENOTDIR;
|
error = -ENOTDIR;
|
||||||
if ((nd->flags & LOOKUP_DIRECTORY) && !nd->inode->i_op->lookup)
|
if ((nd->flags & LOOKUP_DIRECTORY) && !can_lookup(nd->inode))
|
||||||
goto out;
|
goto out;
|
||||||
audit_inode(name, nd->path.dentry, 0);
|
audit_inode(name, nd->path.dentry, 0);
|
||||||
finish_open:
|
finish_open:
|
||||||
|
|
Loading…
Reference in a new issue