Skip to content

Commit 74931da

Browse files
author
Al Viro
committed
make simple_lookup() usable for filesystems that set ->s_d_op
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent ec193cf commit 74931da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/libfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ struct dentry *simple_lookup(struct inode *dir, struct dentry *dentry, unsigned
6161

6262
if (dentry->d_name.len > NAME_MAX)
6363
return ERR_PTR(-ENAMETOOLONG);
64-
d_set_d_op(dentry, &simple_dentry_operations);
64+
if (!dentry->d_sb->s_d_op)
65+
d_set_d_op(dentry, &simple_dentry_operations);
6566
d_add(dentry, NULL);
6667
return NULL;
6768
}

0 commit comments

Comments
 (0)