Skip to content

mbr: Added assertions for overlapping partitions #6700

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 1 commit into from
Apr 30, 2018

Conversation

geky
Copy link
Contributor

@geky geky commented Apr 22, 2018

Description

Add asserts for overlapping MBR parititions. This takes advantage of "is_valid_erase" of the underlying block device, but then has to iterate through all partitions to check if any overlap.

related IOTMORF-2320
cc @deepikabhavnani, @JaniSuonpera, @jenia81, @mottigondabi

Pull request type

[ ] Fix
[ ] Refactor
[ ] New target
[x] Feature
[ ] Breaking change

@jenia81
Copy link

jenia81 commented Apr 22, 2018

@mottigondabi please review

@0xc0170 0xc0170 requested a review from motgon01 April 23, 2018 09:01
@@ -96,6 +96,7 @@ static int partition_absolute(
table->entries[part-1].type = type;

// lba dimensions
MBED_ASSERT(bd->is_valid_erase(offset, size));

Choose a reason for hiding this comment

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

Wondering... shouldn't the assert work on LBA? if yes, it should be moved to L103 MBED_ASSERT(bd->is_valid_erase(lba_offset, lba_size));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, lba_offset and lba_size is in units of erase blocks. The offset and size are in units of bytes. bd->is_valid_erase operates in units of bytes.

We could also have an assert on lba_offset and lba_size but I thought it would be redundant. Do you think we should have that as well?

Choose a reason for hiding this comment

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

No, don't bother.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 26, 2018

@deepikabhavnani, @JaniSuonpera, @jenia81, @mottigondabi

Approvals/request changes?

Copy link

@deepikabhavnani deepikabhavnani left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 27, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Apr 27, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Apr 27, 2018

Exporter Build : FAILURE

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

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 27, 2018

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Apr 27, 2018

Test : FAILURE

Build number : 1679
Test logs :http://mbed-os-logs.s3-website-us-west-1.amazonaws.com/?prefix=logs/6700/1679

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 27, 2018

/morph test

@mbed-ci
Copy link

mbed-ci commented Apr 27, 2018

@mbed-ci
Copy link

mbed-ci commented Apr 28, 2018

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.

9 participants