Whamcloud - gitweb
LU-4082 llite: Chk ret of ll_prep_md_op_data in ll_dir_filler
[fs/lustre-release.git] / lustre / llite / file.c
index edcdda4..8006ad2 100644 (file)
@@ -460,8 +460,7 @@ static int ll_intent_file_open(struct file *file, void *lmm,
                                  itp, NULL);
 
 out:
-        ptlrpc_req_finished(itp->d.lustre.it_data);
-        it_clear_disposition(itp, DISP_ENQ_COMPLETE);
+       ptlrpc_req_finished(req);
         ll_intent_drop_lock(itp);
 
         RETURN(rc);
@@ -670,16 +669,18 @@ restart:
                  * (bug 3430) */
                 /* XXX (green): Should not we bail out on any error here, not
                  * just open error? */
-                rc = it_open_error(DISP_OPEN_OPEN, it);
-                if (rc)
-                        GOTO(out_och_free, rc);
+               rc = it_open_error(DISP_OPEN_OPEN, it);
+               if (rc != 0)
+                       GOTO(out_och_free, rc);
 
-                LASSERT(it_disposition(it, DISP_ENQ_OPEN_REF));
+               LASSERTF(it_disposition(it, DISP_ENQ_OPEN_REF),
+                        "inode %p: disposition %x, status %d\n", inode,
+                        it_disposition(it, ~0), it->d.lustre.it_status);
 
-                rc = ll_local_open(file, it, fd, *och_p);
-                if (rc)
-                        GOTO(out_och_free, rc);
-        }
+               rc = ll_local_open(file, it, fd, *och_p);
+               if (rc)
+                       GOTO(out_och_free, rc);
+       }
        mutex_unlock(&lli->lli_och_mutex);
         fd = NULL;
 
@@ -835,10 +836,7 @@ struct obd_client_handle *ll_lease_open(struct inode *inode, struct file *file,
         * doesn't deal with openhandle, so normal openhandle will be leaked. */
                                LDLM_FL_NO_LRU | LDLM_FL_EXCL);
        ll_finish_md_op_data(op_data);
-       if (req != NULL) {
-               ptlrpc_req_finished(req);
-               it_clear_disposition(&it, DISP_ENQ_COMPLETE);
-       }
+       ptlrpc_req_finished(req);
        if (rc < 0)
                GOTO(out_release_it, rc);
 
@@ -3817,7 +3815,7 @@ again:
        }
 
        op_data = ll_prep_md_op_data(NULL, inode, inode, NULL,
-                       0, 0, LUSTRE_OPC_ANY, NULL);
+                                    0, 0, LUSTRE_OPC_ANY, NULL);
        if (IS_ERR(op_data)) {
                mutex_unlock(&lli->lli_layout_mutex);
                RETURN(PTR_ERR(op_data));