OSDN Git Service

Fix the mkfs final-block-group-too-short bug.
authorJim Meyering <jim@meyering.net>
Tue, 12 Jun 2007 15:25:18 +0000 (17:25 +0200)
committerJim Meyering <jim@meyering.net>
Tue, 12 Jun 2007 18:40:18 +0000 (20:40 +0200)
commitc479897af4e3d9dc39d441a283e14e3d60a75e0e
treed0ee22aa8ef89c95f5b1a8215f9efc330eb28efe
parent4b3626b4bd943239a7bbb1c4db2b0b7d56bb1072
Fix the mkfs final-block-group-too-short bug.

mkfs would fail for certain sizes resulting in a final block-group
that was too small to accommodate the minimum number of admin blocks.
There was already work-around code for when a decremented "numgroups"
was 1.  This change applies that work-around code for larger values of
numgroups, too.  Also, there was an off-by-one error in the guard test
that would allow a few too-small partition sizes to slip through and
provoke the error (see tests/t2000-mkfs.sh for two examples).
This change fixes that, too.
libparted/fs/ext2/ext2_mkfs.c
tests/t2000-mkfs.sh