make simple_lookup() usable for filesystems that set ->s_d_op
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 14 Jul 2013 13:43:25 +0000 (17:43 +0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 14 Jul 2013 13:43:25 +0000 (17:43 +0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/libfs.c

index c3a0837fb861d8d403e6b3b7fadd4056aa42df79..3a3a9b53bf5a974d3c206f31ae402aaf752dd39c 100644 (file)
@@ -61,7 +61,8 @@ struct dentry *simple_lookup(struct inode *dir, struct dentry *dentry, unsigned
 
        if (dentry->d_name.len > NAME_MAX)
                return ERR_PTR(-ENAMETOOLONG);
-       d_set_d_op(dentry, &simple_dentry_operations);
+       if (!dentry->d_sb->s_d_op)
+               d_set_d_op(dentry, &simple_dentry_operations);
        d_add(dentry, NULL);
        return NULL;
 }