OBD_FREE_PTR(ccb);
}
+/**
+ * Add commit callback function, it returns a non-zero value to inform
+ * caller to use sync transaction if necessary.
+ */
int tgt_last_commit_cb_add(struct thandle *th, struct lu_target *tgt,
struct obd_export *exp, __u64 transno)
{
/* report failure to force synchronous operation */
return -EPERM;
- return rc;
+ /* if exp_need_sync is set, return non-zero value to force
+ * a sync transaction. */
+ return rc ? rc : exp->exp_need_sync;
}
struct tgt_new_client_callback {
if (exp->exp_flags & OBD_OPT_FAILOVER)
RETURN(0);
+ if (OBD_FAIL_CHECK(OBD_FAIL_TGT_CLIENT_DEL))
+ RETURN(0);
+
/* 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 */