From: Theodore Ts'o Date: Thu, 2 Nov 2017 13:36:37 +0000 (-0400) Subject: resize2fs: fix free blocks count sanity check for 64-bit file systems X-Git-Tag: v1.43.8~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37e7426debda6cb4058f18a5f1fd5d0851536468;p=thirdparty%2Fe2fsprogs.git 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 --- diff --git a/resize/main.c b/resize/main.c index ba6bb6b18..aa1607743 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;