Whamcloud - gitweb
e2fsck: mark device inodes with EXT4_EXTENTS_FL bad
authorAndreas Dilger <andreas.dilger@intel.com>
Sat, 23 Jun 2018 21:33:58 +0000 (17:33 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 23 Jun 2018 21:54:01 +0000 (17:54 -0400)
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 <andreas.dilger@intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1.c
tests/f_extents/expect.1
tests/f_extents/expect.2
tests/f_extents/image.gz

index 98e8017..8dfa82a 100644 (file)
@@ -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;
 
        /*
index da65f94..b4d36d2 100644 (file)
@@ -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
index 5c9d6a6..c6c9ec2 100644 (file)
@@ -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
index 76fc2fb..caeadc4 100644 (file)
Binary files a/tests/f_extents/image.gz and b/tests/f_extents/image.gz differ