Skip to content

Commit 0525290

Browse files
author
Al Viro
committed
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 <[email protected]>
1 parent 8aac627 commit 0525290

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/namei.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,7 +1976,7 @@ static int path_lookupat(int dfd, const char *name,
19761976
err = complete_walk(nd);
19771977

19781978
if (!err && nd->flags & LOOKUP_DIRECTORY) {
1979-
if (!nd->inode->i_op->lookup) {
1979+
if (!can_lookup(nd->inode)) {
19801980
path_put(&nd->path);
19811981
err = -ENOTDIR;
19821982
}
@@ -2850,7 +2850,7 @@ static int do_last(struct nameidata *nd, struct path *path,
28502850
if ((open_flag & O_CREAT) && S_ISDIR(nd->inode->i_mode))
28512851
goto out;
28522852
error = -ENOTDIR;
2853-
if ((nd->flags & LOOKUP_DIRECTORY) && !nd->inode->i_op->lookup)
2853+
if ((nd->flags & LOOKUP_DIRECTORY) && !can_lookup(nd->inode))
28542854
goto out;
28552855
audit_inode(name, nd->path.dentry, 0);
28562856
finish_open:

0 commit comments

Comments
 (0)