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, May 24, 6:21 PM
Unknown Object (File)
Wed, May 22, 1:11 PM
Unknown Object (File)
Sat, May 18, 6:36 PM
Unknown Object (File)
Mon, May 13, 11:49 PM
Unknown Object (File)
Wed, May 8, 9:27 AM
Unknown Object (File)
Mon, Apr 29, 8:48 PM
Unknown Object (File)
Apr 26 2024, 10:20 AM
Unknown Object (File)
Apr 26 2024, 1:20 AM
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 3582
Build 3622: 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–750

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.