Whamcloud - gitweb
LU-7346 tests: Reintroduce SLOW tests to review process
[fs/lustre-release.git] / lustre / target / tgt_lastrcvd.c
index 1bb9b9b..74e28f8 100644 (file)
@@ -749,7 +749,7 @@ void tgt_boot_epoch_update(struct lu_target *tgt)
 }
 
 /**
- * commit callback, need to update last_commited value
+ * commit callback, need to update last_committed value
  */
 struct tgt_last_committed_callback {
        struct dt_txn_commit_cb  llcc_cb;
@@ -781,7 +781,9 @@ static void tgt_cb_last_committed(struct lu_env *env, struct thandle *th,
        if (ccb->llcc_transno > ccb->llcc_exp->exp_last_committed) {
                ccb->llcc_exp->exp_last_committed = ccb->llcc_transno;
                spin_unlock(&ccb->llcc_tgt->lut_translock);
+
                ptlrpc_commit_replies(ccb->llcc_exp);
+               tgt_cancel_slc_locks(ccb->llcc_transno);
        } else {
                spin_unlock(&ccb->llcc_tgt->lut_translock);
        }
@@ -1727,8 +1729,15 @@ int tgt_txn_start_cb(const struct lu_env *env, struct thandle *th,
                return rc;
 
        if (tgt_is_multimodrpcs_client(tsi->tsi_exp)) {
-               tti->tti_off = atomic_read(&tgt->lut_num_clients) * 8
-                               * sizeof(struct lsd_reply_data);
+               /*
+                * Use maximum possible file offset for declaration to ensure
+                * ZFS will reserve enough credits for a write anywhere in this
+                * file, since we don't know where in the file the write will be
+                * because a replay slot has not been assigned.  This should be
+                * replaced by dmu_tx_hold_append() when available.
+                */
+               tti->tti_off = atomic_read(&tgt->lut_num_clients) * 8 *
+                               sizeof(struct lsd_reply_data);
                tti->tti_buf.lb_buf = NULL;
                tti->tti_buf.lb_len = sizeof(struct lsd_reply_data);
                dto = dt_object_locate(tgt->lut_reply_data, th->th_dev);