[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 2 Mar 2018 16:59:20 -0800
From: Eric Biggers <ebiggers3@...il.com>
To: linux-ext4@...r.kernel.org
Cc: Eric Biggers <ebiggers@...gle.com>
Subject: [PATCH 07/10] e2fsck: drop redundant checks of symlink i_size
From: Eric Biggers <ebiggers@...gle.com>
e2fsck_pass1_check_symlink() verifies that the symlink inode's i_size is
less than the buffer length (60 for fast symlinks, fs->blocksize for
slow symlinks). But it also verifies that len == i_size &&
len < buflen, which already implies i_size < buflen. Thus, remove the
redundant checks of i_size.
Signed-off-by: Eric Biggers <ebiggers@...gle.com>
---
e2fsck/pass1.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index 6a6c5969..3a49e020 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -230,14 +230,10 @@ int e2fsck_pass1_check_symlink(ext2_filsys fs, ext2_ino_t ino,
}
if (ext2fs_is_fast_symlink(inode)) {
- if (inode->i_size >= sizeof(inode->i_block))
- return 0;
-
buf = (char *)inode->i_block;
buflen = sizeof(inode->i_block);
} else {
- if ((inode->i_size >= fs->blocksize) ||
- (inode->i_block[0] < fs->super->s_first_data_block) ||
+ if ((inode->i_block[0] < fs->super->s_first_data_block) ||
(inode->i_block[0] >= ext2fs_blocks_count(fs->super)))
return 0;
--
2.16.2.395.g2e18187dfd-goog
Powered by blists - more mailing lists