From 89ebd1fd43a30b5446aeb0c4e26357bbdb073f08 Mon Sep 17 00:00:00 2001 From: Alexey Lyashkov Date: Wed, 29 Jun 2016 14:36:31 +0300 Subject: [PATCH] LU-8348 recovery: don't send last_committed after panic Do not update last_committed if we are not sure the commit was successful. Signed-off-by: Alexey Lyashkov Seagate-bug-id: MRP-3013 Change-Id: I176b86a01cac46bd7d6af85843135a57a3df0e87 Reviewed-on: http://review.whamcloud.com/21060 Reviewed-by: Mike Pershin Reviewed-by: Alex Zhuravlev Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/target/tgt_lastrcvd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lustre/target/tgt_lastrcvd.c b/lustre/target/tgt_lastrcvd.c index 55e5995..bb3c07d 100644 --- a/lustre/target/tgt_lastrcvd.c +++ b/lustre/target/tgt_lastrcvd.c @@ -781,6 +781,11 @@ static void tgt_cb_last_committed(struct lu_env *env, struct thandle *th, LASSERT(ccb->llcc_tgt != NULL); LASSERT(ccb->llcc_exp->exp_obd == ccb->llcc_tgt->lut_obd); + /* error hit, don't update last committed to provide chance to + * replay data after fail */ + if (err != 0) + goto out; + /* Fast path w/o spinlock, if exp_last_committed was updated * with higher transno, no need to take spinlock and check, * also no need to update obd_last_committed. */ -- 1.8.3.1