Skip to content

Reapply fix for redundant FS size check #6666

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

Merged
merged 2 commits into from
Oct 28, 2019
Merged

Reapply fix for redundant FS size check #6666

merged 2 commits into from
Oct 28, 2019

Conversation

everslick
Copy link
Contributor

My fix for a redundant FS size check was merged, (bde1ce0#diff-6690102111beb33824c743666a874d7c) but later reverted (a389a99#diff-6690102111beb33824c743666a874d7c) I guess by accident.

My fix for a redundant FS size check was merged, (bde1ce0#diff-6690102111beb33824c743666a874d7c) but later reverted (a389a99#diff-6690102111beb33824c743666a874d7c) I guess by accident.
@d-a-v
Copy link
Collaborator

d-a-v commented Oct 26, 2019

This requirement is now ensured by these tests for all FSes:

fs_end = fs_blocksize * (int)((fs_end - fs_start)/fs_blocksize) + fs_start;

fs_start = fs_end

However anyone could use custom definitions or ldscripts so this test is still valid.
The test will prevent the sketch to fail in case of issue, but it is silent (cc @devyte)
I don't think we can use a static_assert() because these constants are not known at compile time (but only at link time).
Should we emit a debug message when start < end ?
Should we add the same test for littleFS ?
Or should we make the test in some python script at around link time ?

@everslick
Copy link
Contributor Author

IMHO, that test should not exist in the first place. The API allows the FS to be placed in flash wherever the user wants. The _FS_START and _FS_END symbols are there to provide sensible default values. If the user does not override them AND start and end point to the same address, then size will be zero and the FS will fail to mount with a reasonable error message. I don't see the harm in not having the test at all.

@d-a-v d-a-v merged commit e4c6a7a into esp8266:master Oct 28, 2019
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.

3 participants