Whamcloud - gitweb
LU-3373 llite: instantiate negative dentry
[fs/lustre-release.git] / lustre / llite / namei.c
index 4c5dfe7..8876711 100644 (file)
@@ -475,6 +475,12 @@ int ll_lookup_it_finish(struct ptlrpc_request *request,
                if (IS_ERR(alias))
                        RETURN(PTR_ERR(alias));
                *de = alias;
+       } else if (!it_disposition(it, DISP_LOOKUP_NEG)  &&
+                  !it_disposition(it, DISP_OPEN_CREATE)) {
+               /* With DISP_OPEN_CREATE dentry will
+                  instantiated in ll_create_it. */
+               LASSERT((*de)->d_inode == NULL);
+               d_instantiate(*de, inode);
        }
 
        if (!it_disposition(it, DISP_LOOKUP_NEG)) {