Page MenuHomeFreeBSD

Fix the error message when creating a zpool on a too-small device
ClosedPublic

Authored by asomers on Sep 28 2017, 3:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 30, 10:58 PM
Unknown Object (File)
Fri, Dec 13, 6:05 PM
Unknown Object (File)
Nov 30 2024, 10:53 PM
Unknown Object (File)
Nov 28 2024, 1:34 PM
Unknown Object (File)
Nov 18 2024, 9:45 PM
Unknown Object (File)
Nov 12 2024, 8:15 PM
Unknown Object (File)
Oct 17 2024, 2:58 AM
Unknown Object (File)
Oct 17 2024, 2:58 AM
Subscribers

Details

Summary

Fix the error message when creating a zpool on a too-small device

Don't check for SPA_MINDEVSIZE in vdev_geom_attach. It's redundant with the
check in vdev_open, and failing to attach here results in the wrong error
message being printed.

PR: 222227
Reported by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>

Diff Detail

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

Event Timeline

This change basically reverts 259168 by mav, which was a performance optimization for "zpool import" when floppy disks were present. Unfortunately, due to the convoluted way that ZFS creates pools, I don't see an obvious way to both return the correct error code and avoid tasting floppies. Do either of you see a way?

avg added reviewers: will, gibbs.

LGTM. Perhaps Justin and Will would want to take a look as well.

This revision is now accepted and ready to land.Sep 28 2017, 4:58 PM

I am not sure think this problem has disappeared since this check was added. While it is less likely to see floppy drive these days, it is still not very reasonable to look for metadata on devices (and partitions) where they can not exist by definition (what IIRC Solaris never does unlike FreeBSD). I think as alternative solution to the reported problem size could be checked not on every open, but only in cases when metadata is going to be read. If on pool creation ZFS core requests specific device to be opened forcefully, we may just do that and let core reject it later with whatever error it prefers.

Fail early when importing pools, but late when creating them.

This revision now requires review to proceed.Sep 28 2017, 10:59 PM
This revision was automatically updated to reflect the committed changes.