diff mbox series

[2/5] lustre: obdclass: llog to handle gaps

Message ID 1652297923-16141-3-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: sync to 2.15 LTS release | expand

Commit Message

James Simmons May 11, 2022, 7:38 p.m. UTC
From: Alex Zhuravlev <bzzz@whamcloud.com>

due to old errors an update llog can contain gaps in index.
this shouldn't block llog processing and recovery. actual
gaps in transaction sequence should be catched by VBR.

WC-bug-id: https://jira.whamcloud.com/browse/LU-15645
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/46837
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/obdclass/llog.c | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)
diff mbox series

Patch

diff --git a/fs/lustre/obdclass/llog.c b/fs/lustre/obdclass/llog.c
index 768bc47..acede87 100644
--- a/fs/lustre/obdclass/llog.c
+++ b/fs/lustre/obdclass/llog.c
@@ -430,23 +430,16 @@  static int llog_process_thread(void *arg)
 				continue;
 			}
 
-			if (rec->lrh_index != index) {
-				/*
-				 * the last time we couldn't parse the block due
-				 * to corruption, thus has no idea about the
-				 * next index, take it from the block, once.
+			if (rec->lrh_index > index) {
+				/* the record itself looks good, but we met a
+				 * gap which can be result of old bugs, just
+				 * keep going
 				 */
-				if (refresh_idx) {
-					refresh_idx = false;
-					index = rec->lrh_index;
-				} else {
-					CERROR("%s: "DFID" Invalid record: index %u but expected %u\n",
-					       loghandle2name(loghandle),
-					       PFID(&loghandle->lgh_id.lgl_oi.oi_fid),
-					       rec->lrh_index, index);
-					rc = -ERANGE;
-					goto out;
-				}
+				CERROR("%s: "DFID" index %u, expected %u\n",
+				       loghandle2name(loghandle),
+				       PFID(&loghandle->lgh_id.lgl_oi.oi_fid),
+				       rec->lrh_index, index);
+				index = rec->lrh_index;
 			}
 
 			CDEBUG(D_OTHER,