From 37e7426debda6cb4058f18a5f1fd5d0851536468 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 2 Nov 2017 09:36:37 -0400 Subject: [PATCH] resize2fs: fix free blocks count sanity check for 64-bit file systems The sanity check that the free blocks count is not insane could fail with a false positive on 64-bit file systems. Fix it. Reported-by: Ian Astle Signed-off-by: Theodore Ts'o --- resize/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resize/main.c b/resize/main.c index ba6bb6b..aa16077 100644 --- a/resize/main.c +++ b/resize/main.c @@ -440,7 +440,8 @@ int main (int argc, char ** argv) !print_min_size) checkit = 1; - if ((fs->super->s_free_blocks_count > fs->super->s_blocks_count) || + if ((ext2fs_free_blocks_count(fs->super) > + ext2fs_blocks_count(fs->super)) || (fs->super->s_free_inodes_count > fs->super->s_inodes_count)) checkit = 1; -- 1.8.3.1