Whamcloud - gitweb
b=19211
authorjxiong <jxiong>
Fri, 21 Aug 2009 02:06:36 +0000 (02:06 +0000)
committerjxiong <jxiong>
Fri, 21 Aug 2009 02:06:36 +0000 (02:06 +0000)
r=fanyong,vitaly

Removed a duplicate md_lock_set_data which happened after the ldlm reference count has been released.

lustre/llite/file.c

index c5d6702..8a05635 100644 (file)
@@ -387,12 +387,12 @@ static int ll_intent_file_open(struct file *file, void *lmm,
                 GOTO(out, rc);
         }
 
                 GOTO(out, rc);
         }
 
-        if (itp->d.lustre.it_lock_mode)
+        rc = ll_prep_inode(&file->f_dentry->d_inode, req, NULL);
+        if (!rc && itp->d.lustre.it_lock_mode)
                 md_set_lock_data(sbi->ll_md_exp,
                                  &itp->d.lustre.it_lock_handle,
                                  file->f_dentry->d_inode, NULL);
 
                 md_set_lock_data(sbi->ll_md_exp,
                                  &itp->d.lustre.it_lock_handle,
                                  file->f_dentry->d_inode, NULL);
 
-        rc = ll_prep_inode(&file->f_dentry->d_inode, req, NULL);
 out:
         ptlrpc_req_finished(itp->d.lustre.it_data);
         it_clear_disposition(itp, DISP_ENQ_COMPLETE);
 out:
         ptlrpc_req_finished(itp->d.lustre.it_data);
         it_clear_disposition(itp, DISP_ENQ_COMPLETE);
@@ -604,9 +604,6 @@ restart:
                                 req = it->d.lustre.it_data;
                                 ptlrpc_req_finished(req);
                         }
                                 req = it->d.lustre.it_data;
                                 ptlrpc_req_finished(req);
                         }
-                        md_set_lock_data(ll_i2sbi(inode)->ll_md_exp,
-                                         &it->d.lustre.it_lock_handle,
-                                         file->f_dentry->d_inode, NULL);
                         goto restart;
                 }
                 OBD_ALLOC(*och_p, sizeof (struct obd_client_handle));
                         goto restart;
                 }
                 OBD_ALLOC(*och_p, sizeof (struct obd_client_handle));