From: Bobi Jam Date: Tue, 15 May 2012 07:50:01 +0000 (+0800) Subject: LU-1235 osd: delete commit cb entry list first X-Git-Tag: 2.2.53~12 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=366211463c0ed0368c29d225146322cd8f61780d;p=fs%2Flustre-release.git LU-1235 osd: delete commit cb entry list first delte commit cb entry list before calling the commit callback functions. Signed-off-by: Bobi Jam Change-Id: I183d31e09666626724f5adcbd977670d558ae219 Reviewed-on: http://review.whamcloud.com/2791 Reviewed-by: Mike Pershin Tested-by: Hudson Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: hongchao.zhang Tested-by: hongchao.zhang Reviewed-by: Oleg Drokin --- diff --git a/lustre/fid/fid_store.c b/lustre/fid/fid_store.c index e89df6f..01b25cb 100644 --- a/lustre/fid/fid_store.c +++ b/lustre/fid/fid_store.c @@ -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); } diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 1c689fe..75a6fe5 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -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); diff --git a/lustre/ptlrpc/target.c b/lustre/ptlrpc/target.c index 9791941..f1347b0 100644 --- a/lustre/ptlrpc/target.c +++ b/lustre/ptlrpc/target.c @@ -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); }