Whamcloud - gitweb
- documentation update for MDS recovery
[fs/lustre-release.git] / lustre / llite / file.c
index 9bcfcaa..672b38c 100644 (file)
@@ -65,15 +65,16 @@ static int ll_file_open(struct inode *inode, struct file *file)
 
         rc = mdc_open(&sbi->ll_mds_client, sbi->ll_mds_conn, inode->i_ino,
                       S_IFREG, file->f_flags, &fd->fd_mdshandle, &req); 
-        if (!fd->fd_mdshandle)
-                CERROR("mdc_open didn't assign fd_mdshandle\n");
-
-        ptlrpc_free_req(req);
+        fd->fd_req = req;
+        ptlrpc_req_finished(req);
         if (rc) {
                 if (rc > 0) 
                         rc = -rc;
                 GOTO(out, rc);
         }
+        if (!fd->fd_mdshandle)
+                CERROR("mdc_open didn't assign fd_mdshandle\n");
+        
 
         oa = ll_oa_from_inode(inode, (OBD_MD_FLMODE | OBD_MD_FLID));
         if (oa == NULL)
@@ -137,12 +138,14 @@ static int ll_file_release(struct inode *inode, struct file *file)
 
         rc = mdc_close(&sbi->ll_mds_client, sbi->ll_mds_conn, inode->i_ino,
                        S_IFREG, fd->fd_mdshandle, &req);
-        ptlrpc_free_req(req);
+        ptlrpc_req_finished(req);
         if (rc) { 
                 if (rc > 0) 
                         rc = -rc;
                 GOTO(out, rc);
         }
+        ptlrpc_free_req(fd->fd_req);
+
         EXIT; 
 
  out: