If the free block or free inodes count are larger than the number of
blocks or inodes in the system, request that the file system be
checked. Otherwise it's possible for calcuate_minimum_resize_size()
to hang in an infinite loop.
This problem was found using American Fuzzy Lop.
Reported-by: Adam Buchbinder <abuchbinder@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
!print_min_size)
checkit = 1;
!print_min_size)
checkit = 1;
+ if ((fs->super->s_free_blocks_count > fs->super->s_blocks_count) ||
+ (fs->super->s_free_inodes_count > fs->super->s_inodes_count))
+ checkit = 1;
+
if (checkit) {
fprintf(stderr,
_("Please run 'e2fsck -f %s' first.\n\n"),
if (checkit) {
fprintf(stderr,
_("Please run 'e2fsck -f %s' first.\n\n"),