Whamcloud - gitweb
LU-8019 llite: Restore proper opencache operations
[fs/lustre-release.git] / lustre / llite / llite_nfs.c
index 9e19e78..0442210 100644 (file)
@@ -137,6 +137,24 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, struct lu_fid *paren
 
        /* N.B. d_obtain_alias() drops inode ref on error */
        result = d_obtain_alias(inode);
+       if (!IS_ERR(result)) {
+               int rc;
+
+               rc = ll_d_init(result);
+               if (rc < 0) {
+                       dput(result);
+                       result = ERR_PTR(rc);
+               } else {
+                       struct ll_dentry_data *ldd = ll_d2d(result);
+
+                       /*
+                        * Need to signal to the ll_file_open that
+                        * we came from NFS and so opencache needs to be
+                        * enabled for this one
+                        */
+                       ldd->lld_nfs_dentry = 1;
+               }
+       }
 
        RETURN(result);
 }