Whamcloud - gitweb
LU-9753 ofd: 64-bits diff variable to avoid overflow
[fs/lustre-release.git] / lustre / ofd / ofd_obd.c
index ebd74a8..cc04521 100644 (file)
@@ -436,7 +436,9 @@ int ofd_obd_disconnect(struct obd_export *exp)
 
        tgt_grant_discard(exp);
 
-       if (exp->exp_obd->obd_replayable) {
+       /* Do not erase record for recoverable client. */
+       if (exp->exp_obd->obd_replayable &&
+           (!exp->exp_obd->obd_fail || exp->exp_failed)) {
                rc = lu_env_init(&env, LCT_DT_THREAD);
                if (rc)
                        GOTO(out, rc);
@@ -889,7 +891,7 @@ out:
  *
  * Supplemental function to destroy object by FID, it is used by request
  * handler and by ofd_echo_destroy() below to find object by FID, lock it
- * and call ofd_object_destroy() finally.
+ * and call ofd_destroy() finally.
  *
  * \param[in] env      execution environment
  * \param[in] ofd      OFD device
@@ -929,7 +931,7 @@ int ofd_destroy_by_fid(const struct lu_env *env, struct ofd_device *ofd,
 
        LASSERT(fo != NULL);
 
-       rc = ofd_object_destroy(env, fo, orphan);
+       rc = ofd_destroy(env, fo, orphan);
        EXIT;
 
        ofd_object_put(env, fo);
@@ -1009,9 +1011,10 @@ static int ofd_echo_create(const struct lu_env *env, struct obd_export *exp,
        struct ofd_device       *ofd = ofd_exp(exp);
        u64                      seq = ostid_seq(&oa->o_oi);
        struct ofd_seq          *oseq;
-       int                      rc = 0, diff = 1;
        long                     granted;
        u64                      next_id;
+       s64 diff = 1;
+       int rc = 0;
        int                      count;
 
        ENTRY;
@@ -1047,13 +1050,13 @@ static int ofd_echo_create(const struct lu_env *env, struct obd_export *exp,
                rc = granted;
                granted = 0;
                CDEBUG(D_HA, "%s: failed to acquire grant space for "
-                      "precreate (%d): rc = %d\n", ofd_name(ofd), diff, rc);
+                      "precreate (%lld): rc = %d\n", ofd_name(ofd), diff, rc);
                diff = 0;
                GOTO(out, rc);
        }
 
        next_id = ofd_seq_last_oid(oseq) + 1;
-       count = ofd_precreate_batch(ofd, diff);
+       count = ofd_precreate_batch(ofd, (int)diff);
 
        rc = ofd_precreate_objects(env, ofd, next_id, oseq, count, 0);
        if (rc < 0) {