From a40ecbb1fc4811201c6ab40292ac3aef1bca54af Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 13 Aug 2001 06:15:36 -0400 Subject: [PATCH] e2fsck/pass1.c (e2fsck_pass1_check_device_inode): If i_blocks is non-zero, then assume that the device/socket/fifo inode is bogus. --- e2fsck/ChangeLog | 3 +++ e2fsck/pass1.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 4c40052..1591c9a 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -3,6 +3,9 @@ * pass1.c (check_size): Fix logic in check_size; the previous code only offered to clear the inode size fields if both size and i_size_high were zero. + (e2fsck_pass1_check_device_inode): If i_blocks is + non-zero, then assume that the device/socket/fifo inode + is bogus. 2001-08-09 Theodore Tso diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 92cc105..2792df7 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -128,6 +128,11 @@ int e2fsck_pass1_check_device_inode(struct ext2_inode *inode) int i; /* + * If i_blocks is non-zero, then this is a bogus device/fifo/socket + */ + if (inode->i_blocks) + return 1; + /* * We should be able to do the test below all the time, but * because the kernel doesn't forcibly clear the device * inode's additional i_block fields, there are some rare -- 1.8.3.1