NFSv4.1: filelayout driver specific code for COMMIT
[cascardo/linux.git] / fs / nfs / getroot.c
index 5596c6a..7979652 100644 (file)
@@ -119,9 +119,6 @@ struct dentry *nfs_get_root(struct super_block *sb, struct nfs_fh *mntfh)
        }
 
        security_d_instantiate(ret, inode);
-
-       if (ret->d_op == NULL)
-               d_set_d_op(ret, server->nfs_client->rpc_ops->dentry_ops);
 out:
        nfs_free_fattr(fsinfo.fattr);
        return ret;
@@ -202,6 +199,10 @@ struct dentry *nfs4_get_root(struct super_block *sb, struct nfs_fh *mntfh)
                goto out;
        }
 
+       if (fattr->valid & NFS_ATTR_FATTR_FSID &&
+           !nfs_fsid_equal(&server->fsid, &fattr->fsid))
+               memcpy(&server->fsid, &fattr->fsid, sizeof(server->fsid));
+
        inode = nfs_fhget(sb, mntfh, fattr);
        if (IS_ERR(inode)) {
                dprintk("nfs_get_root: get root inode failed\n");
@@ -227,9 +228,6 @@ struct dentry *nfs4_get_root(struct super_block *sb, struct nfs_fh *mntfh)
 
        security_d_instantiate(ret, inode);
 
-       if (ret->d_op == NULL)
-               d_set_d_op(ret, server->nfs_client->rpc_ops->dentry_ops);
-
 out:
        nfs_free_fattr(fattr);
        dprintk("<-- nfs4_get_root()\n");