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

drivers/mtd_mapper: fix read_page and write_page backend #17866

Merged
merged 3 commits into from
Mar 26, 2022

Conversation

jue89
Copy link
Contributor

@jue89 jue89 commented Mar 25, 2022

Contribution description

This PR fixes the mtd_mapper backend for read_page and write_page.

The implementation uses mtd_read_page() and mtd_write_page_raw() on the backing device. These methods return 0 on successful read resp. write. But the backend is expected to return the amount of read resp. written bytes.

Testing procedure

Run tests/mtd_mapper. I've added a test triggering this bug. Without this patch it'll be caught in an endless loop.

Issues/PRs references

@jue89 jue89 added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch labels Mar 25, 2022
@jue89 jue89 requested a review from benpicco March 25, 2022 17:42
@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Mar 25, 2022
@benpicco benpicco requested a review from bergzand March 25, 2022 17:43
@jue89 jue89 mentioned this pull request Mar 25, 2022
Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thank you!

@jue89 jue89 enabled auto-merge March 25, 2022 18:08
@jue89
Copy link
Contributor Author

jue89 commented Mar 25, 2022

Thanks for your review!

@benpicco benpicco disabled auto-merge March 26, 2022 13:10
@jue89 jue89 force-pushed the fix/mtd_mapper_backend branch from 9dcac90 to 6cf7e41 Compare March 26, 2022 13:30
@benpicco benpicco enabled auto-merge March 26, 2022 13:39
@benpicco benpicco merged commit 7135c91 into RIOT-OS:master Mar 26, 2022
@jue89 jue89 deleted the fix/mtd_mapper_backend branch March 26, 2022 15:19
@Laczen Laczen mentioned this pull request Apr 7, 2022
@OlegHahm OlegHahm added this to the Release 2022.04 milestone Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants