Whamcloud - gitweb
LU-6981 target: update obd_last_committed 71/15971/3
authorwang di <di.wang@intel.com>
Tue, 11 Aug 2015 11:10:27 +0000 (04:10 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 24 Aug 2015 14:12:33 +0000 (14:12 +0000)
In tgt_reply_data_init(), it should update
last_committed after analyzing those reply_data,
similar as tgt_server_data_init(), otherwise
obd_last_committed might be smaller than the real
committed transno, and then cause recovery_thread
stuck in check_for_next_transno(), which rely on
the correct last committed transno.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: Id036c41028c5bc5bf45f6ad300756e0653929bb3
Reviewed-on: http://review.whamcloud.com/15971
Tested-by: Jenkins
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Grégoire Pichon <gregoire.pichon@bull.net>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/target/tgt_lastrcvd.c

index 4b5041a..2a45895 100644 (file)
@@ -1871,6 +1871,12 @@ int tgt_reply_data_init(const struct lu_env *env, struct lu_target *tgt)
                spin_unlock(&tgt->lut_obd->obd_dev_lock);
        }
 
+       spin_lock(&tgt->lut_translock);
+       /* obd_last_committed is used for compatibility
+        * with other lustre recovery code */
+       tgt->lut_obd->obd_last_committed = tgt->lut_last_transno;
+       spin_unlock(&tgt->lut_translock);
+
        rc = 0;
 
 out: