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,
* 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);
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);
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;