Whamcloud - gitweb
Attempt recovery if the journal contains illegal blocks
authorRichard Mortimer <richm@oldelvet.org.uk>
Mon, 4 Oct 2004 16:56:24 +0000 (17:56 +0100)
committerRichard Mortimer <richm@oldelvet.org.uk>
Mon, 4 Oct 2004 16:56:24 +0000 (17:56 +0100)
e2fsck/ChangeLog
e2fsck/journal.c
tests/ChangeLog
tests/f_badjourblks/expect.1 [new file with mode: 0644]
tests/f_badjourblks/expect.2 [new file with mode: 0644]
tests/f_badjourblks/image.gz [new file with mode: 0644]
tests/f_badjourblks/name [new file with mode: 0644]

index eb85548..c8518af 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-04  Richard Mortimer  <richm@oldelvet.org.uk>
+
+        * journal.c (e2fsck_check_ext3_journal): Attempt recovery of the
+               filesystem if the journal contains illegal block numbers.
+
 2004-07-26  Theodore Ts'o  <tytso@mit.edu>
 
        * pass1.c (process_block): Change the limit of directory size from
index c1b4370..eb4b38d 100644 (file)
@@ -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);
index 48188dd..cf4d56b 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-04  Richard Mortimer  <richm@oldelvet.org.uk>
+
+       * 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  <tytso@mit.edu>
 
        * 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 (file)
index 0000000..e9f4cad
--- /dev/null
@@ -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 (file)
index 0000000..32ca977
--- /dev/null
@@ -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 (file)
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 (file)
index 0000000..103fa7f
--- /dev/null
@@ -0,0 +1 @@
+Illegal blocks in journal inode (and backup in superblock)