This commit fixes a failure when running the commands:
dd if=/dev/zero of=fs bs=1k count=100k; mke2fs fs; resize2fs -Mp fs
We should not try truncating the file system if there is only a single
block group in the file system.
Addresses-Sourceforge-Bug: #
3404051
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs->super->s_blocks_per_group;
if ((fs->group_desc_count == 1) && rem && (rem < overhead))
return EXT2_ET_TOOSMALL;
- if (rem && (rem < overhead+50)) {
+ if ((fs->group_desc_count > 1) && rem && (rem < overhead+50)) {
ext2fs_blocks_count_set(fs->super,
ext2fs_blocks_count(fs->super) - rem);
goto retry;