From b637fed51be8cec6d82e0482e4afddb88806b8d2 Mon Sep 17 00:00:00 2001 From: tappro Date: Thu, 29 Oct 2009 12:07:24 +0000 Subject: [PATCH] Branch HEAD b=20802 i=adilger i=alex take export reference for transaction callback during client addition --- lustre/ldlm/ldlm_lib.c | 2 ++ lustre/mdt/mdt_recovery.c | 7 ++++--- lustre/obdfilter/filter.c | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 334ee8b..ec88bed 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -637,8 +637,10 @@ void target_client_add_cb(struct obd_device *obd, __u64 transno, void *cb_data, spin_lock(&exp->exp_lock); exp->exp_need_sync = 0; spin_unlock(&exp->exp_lock); + class_export_cb_put(exp); } EXPORT_SYMBOL(target_client_add_cb); + static void target_start_and_reset_recovery_timer(struct obd_device *obd, struct ptlrpc_request *req, diff --git a/lustre/mdt/mdt_recovery.c b/lustre/mdt/mdt_recovery.c index 449241b..7fc6064 100644 --- a/lustre/mdt/mdt_recovery.c +++ b/lustre/mdt/mdt_recovery.c @@ -576,7 +576,7 @@ int mdt_client_new(const struct lu_env *env, struct mdt_device *mdt) * transaction so that many connecting clients will not bring * server down with lots of sync writes. */ - mdt_trans_add_cb(th, lut_cb_client, mti->mti_exp); + mdt_trans_add_cb(th, lut_cb_client, class_export_cb_get(mti->mti_exp)); spin_lock(&mti->mti_exp->exp_lock); mti->mti_exp->exp_need_sync = 1; spin_unlock(&mti->mti_exp->exp_lock); @@ -690,8 +690,9 @@ int mdt_client_del(const struct lu_env *env, struct mdt_device *mdt) LBUG(); } - /* write server data at first so last_transno will be save in it in - * any case */ + /* Make sure the server's last_transno is up to date. + * This should be done before zeroing client slot so last_transno will + * be in server data or in client data in case of failure */ mdt_server_data_update(env, mdt); mdt_trans_credit_init(env, mdt, MDT_TXN_LAST_RCVD_WRITE_OP); diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index e159b7b..4f665be 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -362,7 +362,8 @@ static int filter_client_add(struct obd_device *obd, struct obd_export *exp, filter->fo_fsd->lsd_start_epoch; exp->exp_last_request_time = cfs_time_current_sec(); rc = fsfilt_add_journal_cb(obd, 0, handle, - target_client_add_cb, exp); + target_client_add_cb, + class_export_cb_get(exp)); if (rc == 0) { spin_lock(&exp->exp_lock); exp->exp_need_sync = 1; -- 1.8.3.1