Page MenuHomeFreeBSD

md(4): always trim the last partial sector
ClosedPublic

Authored by kib on Oct 13 2024, 9:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 11:17 AM
Unknown Object (File)
Fri, Oct 10, 2:57 AM
Unknown Object (File)
Thu, Oct 2, 5:59 PM
Unknown Object (File)
Sep 15 2025, 5:00 AM
Unknown Object (File)
Sep 2 2025, 10:39 PM
Unknown Object (File)
Aug 28 2025, 1:10 AM
Unknown Object (File)
Aug 18 2025, 5:45 AM
Unknown Object (File)
Aug 8 2025, 5:53 AM
Subscribers

Details

Summary
Do it also for the preloaded disk, in addition to the dynamically
configured device.  This is needed to avoid geom checking alignment and
panicing on read of the last sector, e.g. for label tasting.

PR:     281978

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Oct 13 2024, 9:31 PM

I think the commit message might want a description that this does it for mdimage (loaded from loader) as well now avoiding a panic on boot.
For everything runtime this is NOP if I read it correctly?

Thanks a lot!

This revision is now accepted and ready to land.Oct 13 2024, 9:48 PM

I am surprised by this behaviour, it seems we should at least print a warning if the file is truncated.

kib edited the summary of this revision. (Show Details)

Add printf.

This revision now requires review to proceed.Oct 13 2024, 11:14 PM
This revision is now accepted and ready to land.Oct 13 2024, 11:21 PM
markj added inline comments.
sys/dev/md/md.c
1309
This revision was automatically updated to reflect the committed changes.