-
Notifications
You must be signed in to change notification settings - Fork 3k
littlefs: Map LFS_ERR_CORRUPT to EILSEQ #6772
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
Conversation
Added "do not merge" until removed from #6336 as they should go in together. I only want one release with error code changes. |
woops wrong button |
Little bit doubtful about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with EILSEQ for a corruption error code. LGTM after squashing the extra commit.
@kjbracey-arm I wanted to run this by you because I don't know a better errno code and have been looking for the past year or so. EBADE is used for SSL connection failures, but as far as static storage goes any sort of corruption detection in the OSs I've looked at are just returning as EIO. But in our case, differentiating between a bus/driver issue and a corruption issue is important. Especially looking at security with respect to storage. I'm open to thoughts. |
@geky I earlier had a bit of search, trying to find out what mount/directory reads etc would traditionally do in Unices if presented with duff data, and like you didn't find any obvious answer. Looking again at some old 4.4BSD source I have handy, I can see ISO CD mounting returning Hmph. Looks like something of a POSIX and predecessors omission. Spreading a bit wider than POSIX, QNX has I'd be kind of tempted to add add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving cos I don't have a clearly better suggestion.
All three options are definitely a bit better than EBAD. |
@geky Do you still need to squash before we start CI? |
Previously EBAD (invalid exchange), mapping the error CORRUPT to EILSEQ (illegal byte sequence) makes more sense as a description of the type of error.
Done and done. Barring and major complaints, I think we should go ahead with EILSEQ. |
/morph build |
Build : SUCCESSBuild number : 2014 Triggering tests/morph test |
Test : SUCCESSBuild number : 1824 |
Exporter Build : SUCCESSBuild number : 1666 |
/morph build |
Build : FAILUREBuild number : 2101 |
/morph build |
Build : SUCCESSBuild number : 2111 Triggering tests/morph test |
Test : SUCCESSBuild number : 1912 |
Exporter Build : SUCCESSBuild number : 1745 |
@cmonr LGTM? |
Ooh! It's done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Description
Previously EBAD (invalid exchange), mapping the error CORRUPT to EILSEQ (illegal byte sequence) makes more sense as a description of the type of error.
Will change the underlying error code inside littlefs on the next major version.
related #6336
cc @davidsaada, @kjbracey-arm, @deepikabhavnani
TODO
Pull request type