From 85645a6ff34c4c6c4daa92839a93499cb9f4a778 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 13 Aug 2001 06:11:39 -0400 Subject: [PATCH] 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/ChangeLog | 6 ++++++ e2fsck/pass1.c | 8 ++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index d2027f33..4c40052c 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,9 @@ +2001-08-13 Theodore Tso + + * 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. + 2001-08-09 Theodore Tso * pass1.c, pass2.c, problem.c, problem.h: Fix bug introduced by diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 692ebcf9..92cc105e 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -204,14 +204,10 @@ static void check_size(e2fsck_t ctx, struct problem_context *pctx) { struct ext2_inode *inode = pctx->inode; - if ((LINUX_S_ISBLK(inode->i_mode) || - LINUX_S_ISCHR(inode->i_mode) || - LINUX_S_ISFIFO(inode->i_mode) || - LINUX_S_ISSOCK(inode->i_mode)) && - !inode->i_size || !inode->i_size_high) + if ((inode->i_size == 0) && (inode->i_size_high == 0)) return; - if(!fix_problem(ctx, PR_1_SET_NONZSIZE, pctx)) + if (!fix_problem(ctx, PR_1_SET_NONZSIZE, pctx)) return; inode->i_size = 0;