Page MenuHomeFreeBSD

Fix importing l2arc device by guid
ClosedPublic

Authored by asomers on Jan 11 2016, 7:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Feb 12, 1:01 PM
Unknown Object (File)
Mon, Feb 10, 10:40 PM
Unknown Object (File)
Thu, Jan 30, 2:20 PM
Unknown Object (File)
Dec 10 2024, 1:30 PM
Unknown Object (File)
Dec 6 2024, 11:26 PM
Unknown Object (File)
Dec 5 2024, 2:48 PM
Unknown Object (File)
Nov 21 2024, 4:03 AM
Unknown Object (File)
Nov 8 2024, 3:48 AM
Subscribers

Details

Summary

After r292066, vdev_geom verifies both the vdev and pool guids of device labels
during open. However, spare and l2arc devices don't have pool guids, so
opening them by guid will fail (opening by path, when the pathname is known,
still succeeds). This change allows a vdev to be opened by guid if the label
contains no pool_guid, which is the case for inactive spares and l2arc devices.

Test Plan

sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_test:zpool_import_missing_005_pos

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

asomers retitled this revision from to Fix importing l2arc device by guid.
asomers updated this object.
asomers edited the test plan for this revision. (Show Details)
asomers added a reviewer: delphij.
asomers added a subscriber: smh.
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
604 ↗(On Diff #12125)

Invert order to avoid the spa_guid call if pguid == 0?

delphij edited edge metadata.
delphij added inline comments.
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
604 ↗(On Diff #12125)

Alternatively, we could make spa_guid() call only once per vdev_geom_attach_by_guids because it's an invariant here? I think it's fine to land the change now and then address the optimization as a follow up change.

This revision is now accepted and ready to land.Jan 11 2016, 10:11 PM
This revision was automatically updated to reflect the committed changes.