Skip to content

ExhaustibleBlockDevice: revert commit 10481f2 #12919

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
May 5, 2020
Merged

ExhaustibleBlockDevice: revert commit 10481f2 #12919

merged 2 commits into from
May 5, 2020

Conversation

VeijoPesonen
Copy link
Contributor

@VeijoPesonen VeijoPesonen commented May 4, 2020

Fixes #12832. Reverts commit 10481f2 partially.
Changes made to ExhaustibleBlockDevice hides simulated flash degradation
which is the assumed behavior. Converted back to original behavior writes fail silently.

I'm a bit unsure is this the correct way to handle things but I made an assumption that the ExhaustibleBlockDevice is supposed to silently discard writes instead of producing errors.

Summary of changes

Impact of changes

Migration actions required

Documentation


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@0xc0170
@michalpasztamobica
@SeppoTakalo


Reverts commit 10481f2 partially.
Changes made to ExhaustibleBlockDevice hides simulated flash degradation
which is the assumed behavior. Converted back to original behavior.
@ciarmcom ciarmcom requested review from 0xc0170, michalpasztamobica, SeppoTakalo and a team May 4, 2020 21:00
@ciarmcom
Copy link
Member

ciarmcom commented May 4, 2020

@VeijoPesonen, thank you for your changes.
@0xc0170 @michalpasztamobica @SeppoTakalo @ARMmbed/mbed-os-storage @ARMmbed/mbed-os-maintainers please review.

@0xc0170
Copy link
Contributor

0xc0170 commented May 4, 2020

CI started meanwhile

@mbed-ci
Copy link

mbed-ci commented May 4, 2020

Test run: FAILED

Summary: 1 of 3 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_unittests

@0xc0170
Copy link
Contributor

0xc0170 commented May 5, 2020

As expected, unittest failed

@michalpasztamobica
Copy link
Contributor

I reproduced those locally and can provide a fix soon.

@michalpasztamobica
Copy link
Contributor

@VeijoPesonen , @0xc0170 I added a commit with the unittests fixes on my fork: https://github.com/michalpasztamobica/mbed-os/commits/fix_blockdevice
With these changes the Unittests are passing (and some comments explain that we now expect erase to to fail silently).
@SeppoTakalo , do you also understand that ExhaustibleBlockDevice should be failing silently once erase cycles are over? A few months ago I modified the code, so that the device returns an error if erase is not possible, but it was just how I personally thought the device should behave. I might have been wrong.

@SeppoTakalo
Copy link
Contributor

I'm just assuming that it was developed to simulate flash behaviour, and in many cases the flash writing might fail, and only way to ensure that is to read back the content. Therefore not returning error, when we don't write, is the closest possible behaviour of that imaginary driver on dying flash.
Some flash drivers might note that flash have died, I'm not sure, but lets assume that they don't. That is the trickiest, so this should help to test those tricky situations.

@VeijoPesonen
Copy link
Contributor Author

@0xc0170 I cherry-picked @michalpasztamobica's unit tests changes.

@VeijoPesonen
Copy link
Contributor Author

Need to admit this was a bit hard to figure out what is the right behavior. Maybe if flash would be having ECC enabled we would get proper errors if writes fail. I don't really know.

@0xc0170
Copy link
Contributor

0xc0170 commented May 5, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented May 5, 2020

Test run: SUCCESS

Summary: 6 of 6 test jobs passed
Build number : 2
Build artifacts

@0xc0170 0xc0170 merged commit 72d1918 into ARMmbed:master May 5, 2020
@mergify mergify bot removed the ready for merge label May 5, 2020
@VeijoPesonen VeijoPesonen deleted the fix_blockdevice branch May 5, 2020 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nightly/Prs: littlefs wear leveling tests failing
6 participants