Increase threshold for superblock expansion from ~50% -> ~88% full #910
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Superblock expansion is an irreversible operation. In an effort to prevent superblock expansion from claiming valuable scratch space (important for small, <~8 block filesystems), littlefs prevents superblock expansion when the disk is "mostly full".
In true computer-scientist fashion, this "mostly full" threshold was set to ~50%.
As pointed out by @gbolgradov and @rojer, >~50% utilization is not uncommon, and it can lead to a situation where superblock expansion does not occur in a relatively healthy filesystem, causing focused wear at the root.
To remedy this, the threshold is now increased to ~88% (7/8) full.
This may change in the future and should probably be eventually user configurable.
See #901 for more info.