Page MenuHomeFreeBSD

Check vdev guids during vdev_geom_open except during create, split, and add
ClosedPublic

Authored by asomers on Dec 10 2015, 8:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 16, 11:08 PM
Unknown Object (File)
Dec 13 2024, 4:35 AM
Unknown Object (File)
Nov 24 2024, 1:16 AM
Unknown Object (File)
Nov 23 2024, 10:40 AM
Unknown Object (File)
Nov 22 2024, 5:04 AM
Unknown Object (File)
Nov 17 2024, 4:47 PM
Unknown Object (File)
Nov 17 2024, 8:04 AM
Unknown Object (File)
Oct 30 2024, 11:02 AM

Details

Summary

During vdev_geom_open, require that the vdev guids match the device's label
except during split, add, or create operations. This fixes a bug where the
wrong disk could be returned, and higher layers of ZFS would immediately eject
it again.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c:
o When opening by GUID, require both the pool and vdev

	  GUIDs to match.  While it is highly unlikely for two
	  vdevs to have the same vdev GUIDs, the ZFS storage
	  pool allocator only guarantees they are unique within
	  a pool.

o Modify the open behavior to:

  • If we are opening a vdev that hasn't previously been opened, open
	      by path without checking GUIDs.  
	    - Otherwise, open by path and verify GUIDs.
	    - If that fails, search all geom providers for a device with
	      matching GUIDs.
	    - If that fails, return ENOENT.

Submitted by: gibbs, asomers

Test Plan

zpool create foo mirror da0 da2

  1. Physically remove da1 and da2
  2. Reinsert da2. It should now be called "da1"

zpool online foo <GUID of the vdev formerly known as da2>
zpool status foo

  1. The pool should be healthy. Prior to this change, it would still be degraded
  2. and the missing vdev would still display as REMOVED

Diff Detail

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

Event Timeline

asomers retitled this revision from to Check vdev guids during vdev_geom_open except during create, split, and add.
asomers updated this object.
asomers edited the test plan for this revision. (Show Details)
asomers added a reviewer: smh.
asomers added subscribers: will, gibbs, mav and 2 others.

Overall change looks good just some style nits.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
211–213

style(9) two line spacing for functions without variable declarations

523

Doesn't need wrapping as its under 80cols.

525–526

Should be wrapped due to over 80 cols.

636–652

No need for == B_TRUE as its a bool

640

Typo

649

Duplicated line

asomers edited edge metadata.

Style updates suggested by smh

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
526

Should be 4 spaces indent from ZFS_LOG level, which will allow you to bring pp->name); up too.

More style fixes suggested by smh

smh edited edge metadata.
This revision is now accepted and ready to land.Dec 10 2015, 9:41 PM
This revision was automatically updated to reflect the committed changes.