diskfs / go-diskfs

MIT License
494 stars 112 forks source link

get more accurate read of ext4 superblock in tests #242

Closed deitch closed 1 month ago

deitch commented 1 month ago

The tests were using dumpe2fs/debugfs -R "stats" (same thing) to get information about the superblock to use for tests. Mostly that works, except for lifetime writes. That is rounded to MB, which makes it difficult to get the correct number, and sometimes is wrong, which makes the 2 bytes in the calculation incorrect, and makes the checksum wrong.

This instead reads the specific bytes from the superblock via dd and uses that as the accurate number.