@@ -298,12 +298,8 @@ static struct dentry *ubifs_lookup(struct inode *dir, struct dentry *dentry,
done:
kfree(dent);
fscrypt_free_filename(&nm);
- /*
- * Note, d_splice_alias() would be required instead if we supported
- * NFS.
- */
- d_add(dentry, inode);
- return NULL;
+
+ return d_splice_alias(inode, dentry);
out_inode:
iput(inode);
@@ -525,8 +521,6 @@ static unsigned int vfs_dent_type(uint8_t type)
* properly by means of saving full directory entry name in the private field
* of the file description object.
*
- * This means that UBIFS cannot support NFS which requires full
- * 'seekdir()'/'telldir()' support.
*/
static int ubifs_readdir(struct file *file, struct dir_context *ctx)
{
@@ -2091,6 +2091,9 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
goto out_unlock;
}
+ if (c->parent_pointer && c->double_hash)
+ sb->s_export_op = &ubifs_export_ops;
+
/* Read the root inode */
root = ubifs_iget(sb, UBIFS_ROOT_INO);
if (IS_ERR(root)) {