Whamcloud - gitweb
LU-1235 osd: delete commit cb entry list first
authorBobi Jam <bobijam@whamcloud.com>
Tue, 15 May 2012 07:50:01 +0000 (15:50 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 22 May 2012 04:24:05 +0000 (00:24 -0400)
delte commit cb entry list before calling the commit callback
functions.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I183d31e09666626724f5adcbd977670d558ae219
Reviewed-on: http://review.whamcloud.com/2791
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: hongchao.zhang <hongchao.zhang@whamcloud.com>
Tested-by: hongchao.zhang <hongchao.zhang@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/fid/fid_store.c
lustre/osd-ldiskfs/osd_handler.c
lustre/ptlrpc/target.c

index e89df6f..01b25cb 100644 (file)
@@ -84,7 +84,6 @@ void seq_update_cb(struct lu_env *env, struct thandle *th,
         struct seq_update_callback *ccb;
         ccb = container_of0(cb, struct seq_update_callback, suc_cb);
         ccb->suc_seq->lss_need_sync = 0;
-        cfs_list_del(&ccb->suc_cb.dcb_linkage);
         OBD_FREE_PTR(ccb);
 }
 
index 1c689fe..75a6fe5 100644 (file)
@@ -554,9 +554,11 @@ static void osd_trans_commit_cb(struct journal_callback *jcb, int error)
 
         dt_txn_hook_commit(th);
 
-        /* call per-transaction callbacks if any */
-        cfs_list_for_each_entry_safe(dcb, tmp, &oh->ot_dcb_list, dcb_linkage)
-                dcb->dcb_func(NULL, th, dcb, error);
+       /* call per-transaction callbacks if any */
+       cfs_list_for_each_entry_safe(dcb, tmp, &oh->ot_dcb_list, dcb_linkage) {
+               cfs_list_del_init(&dcb->dcb_linkage);
+               dcb->dcb_func(NULL, th, dcb, error);
+       }
 
         lu_ref_del_at(&lud->ld_reference, oh->ot_dev_link, "osd-tx", th);
         lu_device_put(lud);
index 9791941..f1347b0 100644 (file)
@@ -545,7 +545,6 @@ void lut_cb_last_committed(struct lu_env *env, struct thandle *th,
         if (ccb->llcc_transno)
                 CDEBUG(D_HA, "%s: transno "LPD64" is committed\n",
                        ccb->llcc_lut->lut_obd->obd_name, ccb->llcc_transno);
-        cfs_list_del(&ccb->llcc_cb.dcb_linkage);
         OBD_FREE_PTR(ccb);
 }
 
@@ -597,7 +596,6 @@ void lut_cb_new_client(struct lu_env *env, struct thandle *th,
         cfs_spin_unlock(&ccb->lncc_exp->exp_lock);
         class_export_cb_put(ccb->lncc_exp);
 
-        cfs_list_del(&ccb->lncc_cb.dcb_linkage);
         OBD_FREE_PTR(ccb);
 }