Gitweb:
http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=c6d2155f...
Commit: c6d2155f68d45e603d772884fc75f53e7b651d9f
Parent: d394637d9c6586d8bb5a872f8763b90720f81500
Author: Abhi Das <adas(a)redhat.com>
AuthorDate: Tue Mar 25 22:28:45 2014 -0500
Committer: Abhi Das <adas(a)redhat.com>
CommitterDate: Tue Mar 25 22:28:45 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#1053668
Signed-off-by: Abhi Das <adas(a)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),