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

storage: fix valid partion check with windows formatted sd card #8346

Merged
merged 1 commit into from Oct 26, 2018

Conversation

Projects
None yet
6 participants
@ccli8
Contributor

ccli8 commented Oct 9, 2018

Description

For Windows-formatted SD card, it is not partitioned (no MBR), but its PBR has the same boot signature (0xaa55) as MBR. MBRBlockDevice would easily mis-recognize this SD card has valid partitions if only partition type is checked. This PR adds check by only accepting 0x00 (inactive)/0x80 (active) for valid partition status.

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Breaking change
Fix mis-recognize that Windows-formatted SD card has valid partitions
For Windows-formatted SD card, it is not partitioned (no MBR), but its PBR has the
same boot signature (0xaa55) as MBR. We would easily mis-recognize this SD card has valid
partitions if we only check partition type. We add check by only accepting 0x00 (inactive)
/0x80 (active) for valid partition status.

@0xc0170 0xc0170 requested a review from ARMmbed/mbed-os-storage Oct 9, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Oct 16, 2018

@ARMmbed/mbed-os-storage Please review

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Oct 24, 2018

@ARMmbed/mbed-os-storage Please review

Reminder to review this one

@dannybenor

This comment has been minimized.

dannybenor commented Oct 24, 2018

@geky can you help with this one?

@0xc0170 0xc0170 requested a review from geky Oct 24, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Oct 24, 2018

@ccli8 Can you rephrase : Fix mis-recognize that Windows-formatted SD card has valid partitions please ?

@0xc0170 0xc0170 added needs: work and removed needs: review labels Oct 24, 2018

@geky

geky approved these changes Oct 24, 2018

@geky

This comment has been minimized.

Member

geky commented Oct 24, 2018

This is a good idea 👍 Thanks for submitting a PR.

@ccli8

This comment has been minimized.

Contributor

ccli8 commented Oct 25, 2018

Can you rephrase : Fix mis-recognize that Windows-formatted SD card has valid partitions

@0xc0170 Rephrase what?

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Oct 25, 2018

The titles are used in the release notes. I would rephrase to similar storage: fix win format sd valid partion check

@cmonr

cmonr approved these changes Oct 25, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Oct 25, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Oct 25, 2018

Build : SUCCESS

Build number : 3466
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8346/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@ccli8 ccli8 changed the title from Fix mis-recognize that Windows-formatted SD card has valid partitions to storage: fix valid partion check with windows formatted sd card Oct 26, 2018

@ccli8

This comment has been minimized.

Contributor

ccli8 commented Oct 26, 2018

@0xc0170 I change the title to storage: fix valid partion check with windows formatted sd card.

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Oct 26, 2018

@0xc0170 0xc0170 merged commit fc741f0 into ARMmbed:master Oct 26, 2018

15 checks passed

ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed , RTOS ROM(+0 bytes) RAM(+0 bytes)
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Passed, 653 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9810 cycles (-144 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8372B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details

@ccli8 ccli8 deleted the OpenNuvoton:nuvoton_fix_mbr branch Oct 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment