Fixed the journal handling so that an offer is made to clear the

journal filesystem in all cases.

Fixed a bug in e2fsck which caused it to give spurious I/O manager
bad messages right before crashes.
This commit is contained in:
Theodore Ts'o 2002-03-07 03:13:07 -05:00
parent 3f83020370
commit f2d5c93703
13 changed files with 81 additions and 4 deletions

View File

@ -1,4 +1,14 @@
2002-03-06 <tytso@snap.thunk.org>
2002-03-07 <tytso@snap.thunk.org>
* unix.c (main): Don't close the filesystem before calling
fatal_error(); this just causes a needless warning about a
bad I/O manager magic number.
* journal.c (e2fsck_check_ext3_journal): Offer to clear the inode
in case the journal is too small, or the inode number in
the superblock doesn't appear to be random.
2002-03-06 <tytso@mit.edu>
* problem.h, problem.c: PR_5_BLOCK_RANGE_UNUSED,
PR_5_BLOCK_RANGE_USED, PR_5_INODE_RANGE_UNUSED,

View File

@ -620,7 +620,9 @@ int e2fsck_check_ext3_journal(e2fsck_t ctx)
retval = e2fsck_get_journal(ctx, &journal);
if (retval) {
if (retval == EXT2_ET_BAD_INODE_NUM)
if ((retval == EXT2_ET_BAD_INODE_NUM) ||
(retval == EXT2_ET_JOURNAL_TOO_SMALL) ||
(retval == EXT2_ET_NO_JOURNAL))
return e2fsck_journal_fix_bad_inode(ctx, &pctx);
return retval;
}

View File

@ -831,7 +831,6 @@ restart:
com_err(ctx->program_name, retval,
_("while checking ext3 journal for %s"),
ctx->device_name);
ext2fs_close(ctx->fs);
fatal_error(ctx, 0);
}

View File

@ -1,4 +1,8 @@
2002-03-06 <tytso@snap.thunk.org>
2002-03-07 <tytso@mit.edu>
* f_miss_journal, f_extra_journal: Added new test cases.
2002-03-06 <tytso@mit.edu>
* f_badorphan, f_badtable, f_bbinode, f_dupsuper, f_expand,
f_illbbitmap, f_illibitmap, f_illitable, f_imagic,

View File

@ -0,0 +1,23 @@
Superblock doesn't have has_journal flag, but has ext3 journal inode.
Clear? yes
Pass 1: Checking inodes, blocks, and sizes
Journal inode is not in use, but contains data. Clear? yes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences: -(50--1079)
Fix? yes
Free blocks count wrong for group #0 (968, counted=1998).
Fix? yes
Free blocks count wrong (968, counted=1998).
Fix? yes
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
test_filesys: 11/256 files (0.0% non-contiguous), 50/2048 blocks
Exit status is 1

View File

@ -0,0 +1,7 @@
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
test_filesys: 11/256 files (0.0% non-contiguous), 50/2048 blocks
Exit status is 0

Binary file not shown.

View File

@ -0,0 +1 @@
Valid journal inode, but has_journal feature not present

View File

@ -0,0 +1,23 @@
Superblock has a bad ext3 journal (inode 8).
Clear? yes
*** ext3 journal has been deleted - filesystem is now ext2 only ***
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences: -(50--1079)
Fix? yes
Free blocks count wrong for group #0 (968, counted=1998).
Fix? yes
Free blocks count wrong (968, counted=1998).
Fix? yes
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
test_filesys: 11/256 files (0.0% non-contiguous), 50/2048 blocks
Exit status is 1

View File

@ -0,0 +1,7 @@
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
test_filesys: 11/256 files (0.0% non-contiguous), 50/2048 blocks
Exit status is 0

Binary file not shown.

View File

@ -0,0 +1 @@
Non-existent journal inode

BIN
tests/f_swapfs/image Normal file

Binary file not shown.