Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make FS scan more robust #6

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Make FS scan more robust #6

wants to merge 1 commit into from

Conversation

bugadani
Copy link
Member

@bugadani bugadani commented Jun 16, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant