Whamcloud - gitweb
LU-8826 recovery: don't shrink recovery hard time
[fs/lustre-release.git] / lustre / target / tgt_lastrcvd.c
index c3811cd..8be1a07 100644 (file)
@@ -812,6 +812,10 @@ out:
        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)
 {
@@ -842,7 +846,9 @@ int tgt_last_commit_cb_add(struct thandle *th, struct lu_target *tgt,
                /* 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 {
@@ -1073,6 +1079,9 @@ int tgt_client_del(const struct lu_env *env, struct obd_export *exp)
        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 */