gfs2-utils: RHEL7 - fsck.gfs2: fix corner case sb_seg_size correction for single journal fs

Abhijith Das adas at fedoraproject.org
Wed Mar 26 03:35:06 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=f2d6124acc5b185d2674171df3deb6077a35111b
Commit:        f2d6124acc5b185d2674171df3deb6077a35111b
Parent:        d6b100b8e2315ab6e072f02bf63a1aacefda6f7d
Author:        Abhi Das <adas at redhat.com>
AuthorDate:    Tue Mar 25 22:28:45 2014 -0500
Committer:     Abhi Das <adas at redhat.com>
CommitterDate: Tue Mar 25 22:34:13 2014 -0500

fsck.gfs2: fix corner case sb_seg_size correction for single journal fs

Spotted an error in the single journal sb_seg_size correction. This
patch fixes it and is an addendum patch to the previous two patches
posted for this bz1053668

Resolves: rhbz#1079507
Signed-off-by: Abhi Das <adas at redhat.com>
---
 gfs2/fsck/initialize.c |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 33cf85b..9ada7d2 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -1414,14 +1414,22 @@ static int correct_journal_seg_size(struct gfs2_sbd *sdp)
 	}
 	gfs_jindex_in(&ji_0, buf);
 
-	if (sdp->md.journals == 1 && sbd1->sb_seg_size == 0) {
-		if (!query(_("The gfs2 journal segment size is 0 and a correct value\n"
-			     "cannot be determined in a single-journal filesystem.\n"
-			     "Continue with default? (y/n) "))) {
-			log_crit(_("Error: Cannot proceed without a valid sb_seg_size value.\n"));
-			return -1;
+	if (sdp->md.journals == 1) {
+		if (sbd1->sb_seg_size == 0) {
+			if (!query(_("The gfs2 journal segment size is 0 and a"
+				     " correct value cannot be determined in a"
+				     " single-journal filesystem.\n"
+				     "Continue with default? (y/n) "))) {
+				log_crit(_("Error: Cannot proceed without a valid"
+					   " sb_seg_size value.\n"));
+				return -1;
+			}
+			goto out;
 		}
-		goto out;
+		/* Don't mess with sb_seg_size because we don't know what
+		 * it needs to be
+		 */
+		return 0;
 	}
 
 	count = gfs2_readi(sdp->md.jiinode, buf, sizeof(struct gfs_jindex),


More information about the cluster-commits mailing list