From: Andreas Dilger Date: Sat, 23 Jun 2018 21:33:58 +0000 (-0400) Subject: e2fsck: mark device inodes with EXT4_EXTENTS_FL bad X-Git-Tag: v1.44.3-rc1~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9302bda131f98323b41ff14d2b488ec3f0beb7d7;p=thirdparty%2Fe2fsprogs.git e2fsck: mark device inodes with EXT4_EXTENTS_FL bad Mark device inodes bad if they have the EXT4_EXTENTS_FL set, since this should never happen and likely shows the inode is corrupt. Change-Id: I85ab667b39ff57c658a779e59f692a080217690e Signed-off-by: Andreas Dilger Signed-off-by: Theodore Ts'o --- diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 98e80174f..8dfa82a07 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -151,10 +151,10 @@ int e2fsck_pass1_check_device_inode(ext2_filsys fs EXT2FS_ATTR((unused)), int i; /* - * If the index flag is set, then this is a bogus + * If the index or extents flag is set, then this is a bogus * device/fifo/socket */ - if (inode->i_flags & EXT2_INDEX_FL) + if (inode->i_flags & (EXT2_INDEX_FL | EXT4_EXTENTS_FL)) return 0; /* diff --git a/tests/f_extents/expect.1 b/tests/f_extents/expect.1 index da65f9496..b4d36d209 100644 --- a/tests/f_extents/expect.1 +++ b/tests/f_extents/expect.1 @@ -2,14 +2,6 @@ Pass 1: Checking inodes, blocks, and sizes Inode 12 is in extent format, but superblock is missing EXTENTS feature Fix? yes -Inode 12 has an invalid extent - (logical block 0, invalid physical block 21994527527949, len 17) -Clear? yes - -Inode 12 extent tree (at level 1) could be shorter. Fix? yes - -Inode 12, i_blocks is 34, should be 0. Fix? yes - Inode 13 missing EXTENT_FL, but is in extents format Fix? yes @@ -19,47 +11,57 @@ Clear? yes Inode 16, i_blocks is 16, should be 12. Fix? yes -Inode 17 has an invalid extent - (logical block 0, invalid physical block 22011707397135, len 15) -Clear? yes +Inode 18 has corrupt extent header. Clear inode? yes -Inode 17 extent tree (at level 1) could be shorter. Fix? yes +Inode 18, i_blocks is 2, should be 0. Fix? yes -Inode 17, i_blocks is 32, should be 0. Fix? yes -Inode 18 has corrupt extent header. Clear inode? yes +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 12: 5133 5124--5125 5129 5132--5133 5142--5145 +Multiply-claimed block(s) in inode 17: 5124--5125 5129 5132 5142--5145 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 2 inodes containing multiply-claimed blocks.) -Inode 18, i_blocks is 2, should be 0. Fix? yes +File /fdup1 (inode #12, mod time Wed Jul 5 21:55:26 2006) + has 10 multiply-claimed block(s), shared with 1 file(s): + /fdup2 (inode #17, mod time Wed Jul 5 21:55:27 2006) +Clone multiply-claimed blocks? yes -Special (device/socket/fifo) file (inode 19) has extents -or inline-data flag set. Clear? yes +File /fdup2 (inode #17, mod time Wed Jul 5 21:55:27 2006) + has 8 multiply-claimed block(s), shared with 1 file(s): + /fdup1 (inode #12, mod time Wed Jul 5 21:55:26 2006) +Multiply-claimed blocks already reassigned or cloned. -Pass 1E: Optimizing extent trees Pass 2: Checking directory structure Entry 'fbad-flag' in / (2) has deleted/unused inode 18. Clear? yes +Inode 19 (/fbad-sock) is an illegal FIFO. +Clear? yes + Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information -Block bitmap differences: -1081 +4611 -(4613--4614) -(5121--5142) +Block bitmap differences: +4611 -(4613--4614) -(5121--5122) +(5143--5146) Fix? yes -Free blocks count wrong for group #0 (7081, counted=7100). +Free blocks count wrong for group #0 (7081, counted=7067). Fix? yes -Free blocks count wrong (7081, counted=7100). +Free blocks count wrong (7081, counted=7067). Fix? yes Inode bitmap differences: -18 Fix? yes -Free inodes count wrong for group #0 (237, counted=238). +Free inodes count wrong for group #0 (238, counted=239). Fix? yes -Free inodes count wrong (237, counted=238). +Free inodes count wrong (238, counted=239). Fix? yes test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** -test_filesys: 18/256 files (5.6% non-contiguous), 1092/8192 blocks +test_filesys: 17/256 files (17.6% non-contiguous), 1125/8192 blocks Exit status is 1 diff --git a/tests/f_extents/expect.2 b/tests/f_extents/expect.2 index 5c9d6a671..c6c9ec2d8 100644 --- a/tests/f_extents/expect.2 +++ b/tests/f_extents/expect.2 @@ -3,5 +3,5 @@ Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information -test_filesys: 18/256 files (5.6% non-contiguous), 1092/8192 blocks +test_filesys: 17/256 files (17.6% non-contiguous), 1125/8192 blocks Exit status is 0 diff --git a/tests/f_extents/image.gz b/tests/f_extents/image.gz index 76fc2fbe2..caeadc43e 100644 Binary files a/tests/f_extents/image.gz and b/tests/f_extents/image.gz differ