From: Richard Mortimer Date: Mon, 4 Oct 2004 16:56:24 +0000 (+0100) Subject: Attempt recovery if the journal contains illegal blocks X-Git-Tag: E2FSPROGS-1_36~127 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=6e4fbbeb500d6aa7aaa193f689356c487d461ede;p=tools%2Fe2fsprogs.git Attempt recovery if the journal contains illegal blocks --- diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index eb85548..c8518af 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,8 @@ +2004-10-04 Richard Mortimer + + * journal.c (e2fsck_check_ext3_journal): Attempt recovery of the + filesystem if the journal contains illegal block numbers. + 2004-07-26 Theodore Ts'o * pass1.c (process_block): Change the limit of directory size from diff --git a/e2fsck/journal.c b/e2fsck/journal.c index c1b4370..eb4b38d 100644 --- a/e2fsck/journal.c +++ b/e2fsck/journal.c @@ -665,6 +665,7 @@ int e2fsck_check_ext3_journal(e2fsck_t ctx) retval = e2fsck_get_journal(ctx, &journal); if (retval) { if ((retval == EXT2_ET_BAD_INODE_NUM) || + (retval == EXT2_ET_BAD_BLOCK_NUM) || (retval == EXT2_ET_JOURNAL_TOO_SMALL) || (retval == EXT2_ET_NO_JOURNAL)) return e2fsck_journal_fix_bad_inode(ctx, &pctx); diff --git a/tests/ChangeLog b/tests/ChangeLog index 48188dd..cf4d56b 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +2004-10-04 Richard Mortimer + + * f_badjourblks: Add test case which tests a Journal with illegal + block numbers in both the journal inode and the superblock + inode backup. + 2004-09-17 Theodore Ts'o * test_script.in: Remove XSI:isms for greater portability. diff --git a/tests/f_badjourblks/expect.1 b/tests/f_badjourblks/expect.1 new file mode 100644 index 0000000..e9f4cad --- /dev/null +++ b/tests/f_badjourblks/expect.1 @@ -0,0 +1,25 @@ +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 +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 (7112, counted=8142). +Fix? yes + +Free blocks count wrong (7112, counted=8142). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/256 files (0.0% non-contiguous), 50/8192 blocks +Exit status is 1 diff --git a/tests/f_badjourblks/expect.2 b/tests/f_badjourblks/expect.2 new file mode 100644 index 0000000..32ca977 --- /dev/null +++ b/tests/f_badjourblks/expect.2 @@ -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/8192 blocks +Exit status is 0 diff --git a/tests/f_badjourblks/image.gz b/tests/f_badjourblks/image.gz new file mode 100644 index 0000000..e336a4b Binary files /dev/null and b/tests/f_badjourblks/image.gz differ diff --git a/tests/f_badjourblks/name b/tests/f_badjourblks/name new file mode 100644 index 0000000..103fa7f --- /dev/null +++ b/tests/f_badjourblks/name @@ -0,0 +1 @@ +Illegal blocks in journal inode (and backup in superblock)