This PR changes incorrect object handling so we won't immediately fail when we encounter an incorrect object. Incorrect objects may be present due to power loss, as the result of the following:
Power cuts out while deleting an object. The object may be located anywhere. If the object is not the last one, it should have a valid length.
Power cuts out while writing an object. The object will be the last one in the block. We may simply disallow allocating in the block. If we can prove that the object has a valid length that matches the used bytes in the block, we may treat the object as deleted.
Power cuts out while allocating an object. Same as above, but the incorrect byte may be the object's type, not it's state.
Additionally, we may have incorrect block headers, in case power cuts out while erasing a block. We should immediately reformat these blocks.
Related to #2 - I still don't know why the corruption happened (firmware locked up while writing a file, most likely), but we shouldn't completely trash the FS with this PR.
This PR changes incorrect object handling so we won't immediately fail when we encounter an incorrect object. Incorrect objects may be present due to power loss, as the result of the following:
Additionally, we may have incorrect block headers, in case power cuts out while erasing a block. We should immediately reformat these blocks.
Related to #2 - I still don't know why the corruption happened (firmware locked up while writing a file, most likely), but we shouldn't completely trash the FS with this PR.