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)
Thu, Dec 12, 9:33 PM
Unknown Object (File)
Thu, Dec 5, 5:21 AM
Unknown Object (File)
Nov 23 2024, 1:18 AM
Unknown Object (File)
Nov 7 2024, 4:15 AM
Unknown Object (File)
Nov 3 2024, 1:59 PM
Unknown Object (File)
Nov 3 2024, 12:39 PM
Unknown Object (File)
Oct 30 2024, 9:36 AM
Unknown Object (File)
Oct 30 2024, 2:51 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.