Page MenuHomeFreeBSD

Don't panic when tasting a disk with sectorsize=0
ClosedPublic

Authored by asomers on Nov 9 2022, 3:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 4:25 PM
Unknown Object (File)
Mon, Apr 22, 4:25 PM
Unknown Object (File)
Mon, Apr 22, 4:25 PM
Unknown Object (File)
Mon, Apr 22, 4:25 PM
Unknown Object (File)
Mon, Apr 22, 4:12 PM
Unknown Object (File)
Thu, Apr 18, 8:31 PM
Unknown Object (File)
Wed, Apr 17, 9:51 PM
Unknown Object (File)
Dec 20 2023, 8:22 AM
Subscribers

Details

Summary

This can sometimes happen with broken HDDs.

MFC after: 2 weeks
Sponsored by: Axcient

Test Plan

Manually tested with a suitably broken HDD

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 48243
Build 45129: arc lint + arc unit

Event Timeline

Seems ok, but why not handle it in g_label_taste(), or even at some higher level in GEOM (maybe g_disk_create())? I can't think of any classes that will do something sane with a provider with sectorsize 0...

This revision is now accepted and ready to land.Nov 9 2022, 4:24 PM

Seems ok, but why not handle it in g_label_taste(), or even at some higher level in GEOM (maybe g_disk_create())? I can't think of any classes that will do something sane with a provider with sectorsize 0...

Ok, I'll move the part from g_label_ufs.c into g_label_taste. I don't want to move it higher up though, because g_label_taste can also be called in the resize path. And I'll leave the changes to the other label classes, because they're 0-cost.

  • Perform the check earlier
This revision now requires review to proceed.Nov 9 2022, 4:55 PM
markj added inline comments.
sys/geom/label/g_label_ufs.c
142

I'd convert the other label types to use KASSERT()s as well. Sure the runtime checks are zero-cost, but the inconsistency is confusing.

This revision is now accepted and ready to land.Nov 9 2022, 5:03 PM

Doh! I had hit 'looks good' too, but it didn't seem to register...