gfs2-utils: RHEL7 - fsck.gfs2: Fix journal sequence number reporting problem

Andrew Price andyp at fedoraproject.org
Tue Apr 7 21:24:01 UTC 2015


Gitweb:        http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=4e30050ed287bf96305dbab1f994b0e06096eb4c
Commit:        4e30050ed287bf96305dbab1f994b0e06096eb4c
Parent:        5c82136b8b26b063542af8850c494cacb5c97c87
Author:        Bob Peterson <rpeterso at redhat.com>
AuthorDate:    Fri Jan 23 09:12:57 2015 -0600
Committer:     Andrew Price <anprice at redhat.com>
CommitterDate: Wed Apr 1 16:51:35 2015 +0100

fsck.gfs2: Fix journal sequence number reporting problem

This bug was spotted by coverity. The fsck.gfs2 should include a line
to report the number of journal sequence errors fixed. It was coded
improperly so that it was never displayed. This patch fixes the code
so that the message will be printed properly.
---
 gfs2/fsck/fs_recovery.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index abb8187..9be5a95 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -436,10 +436,9 @@ static int check_journal_seq_no(struct gfs2_inode *ip, int fix)
 			  (unsigned long long)lowest_seq,
 			  (unsigned long long)highest_seq,
 			  (unsigned long long)prev_seq);
-		if (!fix) {
-			seq_errors++;
+		seq_errors++;
+		if (!fix)
 			continue;
-		}
 		highest_seq++;
 		lh.lh_sequence = highest_seq;
 		prev_seq = lh.lh_sequence;
@@ -449,8 +448,10 @@ static int check_journal_seq_no(struct gfs2_inode *ip, int fix)
 		gfs2_log_header_out(&lh, bh);
 		brelse(bh);
 	}
-	if (seq_errors && fix)
+	if (seq_errors && fix) {
 		log_err(_("%d sequence errors fixed.\n"), seq_errors);
+		seq_errors = 0;
+	}
 	return seq_errors;
 }
 


More information about the cluster-commits mailing list