- /* Don't force sync on disconnect if aborting recovery,
- * or it does num_clients * num_osts. b=17194 */
- need_sync = (!exp->exp_libclient || exp->exp_need_sync) &&
- !(exp->exp_flags & OBD_OPT_ABORT_RECOV);
-
- /*
- * This may be called from difficult reply handler path and
- * mdt->mdt_last_rcvd may be NULL that time.
- */
- if (mdt->mdt_last_rcvd != NULL) {
- mdt_trans_credit_init(env, mdt, MDT_TXN_LAST_RCVD_WRITE_OP);
-
- spin_lock(&exp->exp_lock);
- exp->exp_need_sync = need_sync;
- spin_unlock(&exp->exp_lock);
-
- th = mdt_trans_start(env, mdt);
- if (IS_ERR(th))
- GOTO(free, rc = PTR_ERR(th));
-
- if (need_sync) {
- /*
- * Until this operations will be committed the sync
- * is needed for this export.
- */
- mdt_trans_add_cb(th, lut_cb_client, exp);
- }
+ /* 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);