Page MenuHomeFreeBSD

Fixup the geliboot sector round code
ClosedPublic

Authored by allanjude on May 5 2016, 1:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 3:47 AM
Unknown Object (File)
Tue, Nov 12, 9:21 PM
Unknown Object (File)
Tue, Nov 12, 6:34 PM
Unknown Object (File)
Oct 5 2024, 10:00 PM
Unknown Object (File)
Oct 5 2024, 1:50 PM
Unknown Object (File)
Oct 2 2024, 8:24 PM
Unknown Object (File)
Oct 1 2024, 10:12 PM
Unknown Object (File)
Oct 1 2024, 7:19 PM
Subscribers

Details

Summary

Replace all rounding with the round{up,down}2 macros, a missing set of braces caused the previous code to be incorrect Also, replace alloca() with malloc() because alloca() can return an allocation that is actually invalid, causing boot to fail

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3579
Build 3619: arc lint + arc unit

Event Timeline

allanjude retitled this revision from to Fixup the geliboot sector round code Replace all rounding with the round{up,down}2 macros, a missing set of braces caused the previous code to be incorrect Also, replace alloca() with malloc() because alloca() can return an allocation that is....
allanjude updated this object.
allanjude edited the test plan for this revision. (Show Details)
allanjude added reviewers: ed, emaste, peter.
sys/boot/i386/libi386/biosdisk.c
749

since bd structure is already having bd_sectorsize member, I would suggest to use bd_sectorsize here and below and avoid hardcoded constant; this will help to get ready for non-512B sector disks.

769

bd_io() is returning -1 in case of error, I would keep the same logic, maybe also set errno to ENOMEM.

Updated with feedback from tsoome

Updating D6213: Fixup the geliboot sector round code

Replace all rounding with the round{up,down}2 macros, a missing set of braces caused the previous code to be incorrect

Also, replace alloca() with malloc() because alloca() can return an allocation that is...

allanjude retitled this revision from Fixup the geliboot sector round code Replace all rounding with the round{up,down}2 macros, a missing set of braces caused the previous code to be incorrect Also, replace alloca() with malloc() because alloca() can return an allocation that is... to Fixup the geliboot sector round code.
ed edited edge metadata.
This revision is now accepted and ready to land.May 6 2016, 9:41 AM
allanjude edited edge metadata.

Make it actually compile

This revision now requires review to proceed.May 19 2016, 6:34 PM
ed edited edge metadata.
This revision is now accepted and ready to land.May 19 2016, 7:34 PM
This revision was automatically updated to reflect the committed changes.