To catch things like bug #496982 before the corrupted images make it out to the user, I think that the __resize_filesystem and __resize_to_minimal methods should fsck the filesystem post-resize, or at least a fsck of the final image should happen some time prior to the process completion, and the whole endeavour should fail if a fsck is not clean... I hacked up a patch something like: --- imgcreate/fs.py.orig 2009-04-14 13:05:52.000000000 -0500 +++ imgcreate/fs.py. 2009-04-23 10:35:29.610358871 -0500 @@ -395,8 +395,9 @@ self.disk.expand(size) self.__fsck() - resize2fs(self.disk.lofile, size) + self.__fsck() + return size def __create(self): @@ -453,6 +454,7 @@ top = t else: bot = t + self.__fsck() return top def resparse(self, size = None): and it caught the corruption mentioned in bug #496982, although it didn't stop the process. Even if this can't be formally added pre-f11-GA, I'd strongly recommend that the livecd image be hand-fsck'd before we ship it. Thanks! -Eric
Added in git. And if we want to stop the process on certain return codes from fsck, just let me know what the exit codes to die on are.
The exit code returned by e2fsck is the sum of the following condi- tions: 0 - No errors 1 - File system errors corrected 2 - File system errors corrected, system should be rebooted 4 - File system errors left uncorrected 8 - Operational error 16 - Usage or syntax error 32 - E2fsck canceled by user request 128 - Shared library error I think I'd say anything other than 0 should stop the process, unless you think otherwise... maybe with a way to override it for "corrected" errors, since in the end the person running this tool can't control the kernel bugs ;)
as long as we're checking error statuses, maybe we should check that the umount before the resize is actually successful (for example, that it didn't refuse to unmount because of open files).
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle. Changing version to '11'. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Closing out bug that's been in MODIFIED for a while.