From 9b5657591b1db9b82fe433f3f90e496f3df6a851 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Wed, 13 Dec 2000 18:50:22 +0000 Subject: [PATCH] ChangeLog, super.c: super.c (release_orphan_inodes): Fix spelling typo in error message. ChangeLog, unix.c: unix.c (main): Clarify coments (no code changes) ChangeLog, journal.c: journal.c (e2fsck_check_ext3_journal): Check to make sure the journal fields are consistent if any of the superblock fields are set. (Backs out erroneous change made by sct, pointed out by Andreas.) --- e2fsck/ChangeLog | 9 +++++++++ e2fsck/journal.c | 10 ++++++++-- e2fsck/super.c | 2 +- e2fsck/unix.c | 7 +++++-- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index e51a154..966e5a9 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,5 +1,14 @@ 2000-12-13 Theodore Ts'o + * journal.c (e2fsck_check_ext3_journal): Check to make sure the + journal fields are consistent if any of the superblock + fields are set. (Backs out erroneous change made by sct, + pointed out by Andreas.) + + * unix.c (main): Clarify coments (no code changes) + + * super.c (release_orphan_inodes): Fix spelling typo in error message. + * pass1.c (e2fsck_pass1): Offer to update the filesystem revision level if we need to set large files flag. Patch from Andreas Dilger. diff --git a/e2fsck/journal.c b/e2fsck/journal.c index c904333..1c59609 100644 --- a/e2fsck/journal.c +++ b/e2fsck/journal.c @@ -465,6 +465,10 @@ static void e2fsck_journal_release(e2fsck_t ctx, journal_t *journal, int reset) ext2fs_free_mem((void **)&journal); } +/* + * This function makes sure that the superblock fields regarding the + * journal are consistent. + */ int e2fsck_check_ext3_journal(e2fsck_t ctx) { struct ext2fs_sb *s = (struct ext2fs_sb *)ctx->fs->super; @@ -475,8 +479,10 @@ int e2fsck_check_ext3_journal(e2fsck_t ctx) int retval; /* If we don't have any journal features, don't do anything more */ - if (!(s->s_feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL)) - return 0; + if (!(s->s_feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL) && + !recover && s->s_journal_inum == 0 && s->s_journal_dev == 0 && + uuid_is_null(s->s_journal_uuid)) + return 0; #ifdef JFS_DEBUG journal_enable_debug = 2; diff --git a/e2fsck/super.c b/e2fsck/super.c index 76ce465..92eb460 100644 --- a/e2fsck/super.c +++ b/e2fsck/super.c @@ -244,7 +244,7 @@ static int release_orphan_inodes(e2fsck_t ctx) } block_buf = (char *) e2fsck_allocate_memory(ctx, fs->blocksize * 4, - "block interate buffer"); + "block iterate buffer"); e2fsck_read_bitmaps(ctx); while (ino) { diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 29e13f5..c19a289 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -795,8 +795,7 @@ restart: ctx->device_name = ctx->filesystem_name; /* - * Check to see if we need to do ext3-style recovery. If so, - * do it, and then restart the fsck. + * Make sure the ext3 superblock fields are consistent. */ retval = e2fsck_check_ext3_journal(ctx); if (retval) { @@ -807,6 +806,10 @@ restart: fatal_error(ctx, 0); } + /* + * Check to see if we need to do ext3-style recovery. If so, + * do it, and then restart the fsck. + */ if (s->s_feature_incompat & EXT3_FEATURE_INCOMPAT_RECOVER) { if (ctx->options & E2F_OPT_READONLY) { printf(_("Warning: skipping journal recovery " -- 1.8.3.1