Create zap for root vdev

And add it to the AVZ, this is not backwards compatible with older pools
due to an assertion in spa_sync() that verifies the number of ZAPs of
all vdevs matches the number of ZAPs in the AVZ.

Granted, the assertion only applies to #DEBUG builds - still, a feature
flag is introduced to avoid the assertion, com.klarasystems:vdev_zaps_v2

Notably, this allows to get/set properties on the root vdev:

    % zpool set user:prop=value <pool> root-0

Before this commit, it was already possible to get/set properties on
top-level vdevs with the syntax <type>-<vdev_id> (e.g. mirror-0):

    % zpool set user:prop=value <pool> mirror-0

This syntax also applies to the root vdev as it is is of type 'root'
with a vdev_id of 0, root-0. The keyword 'root' as an alias for
'root-0'.

The following tests have been added:

    - zpool get all properties from root vdev
    - zpool set a property on root vdev
    - verify root vdev ZAP is created

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Wing <rob.wing@klarasystems.com>
Sponsored-by: Seagate Technology
Submitted-by: Klara, Inc.
Closes #14405
This commit is contained in:
rob-wing
2023-04-20 09:07:56 -08:00
committed by GitHub
parent 71d191ef25
commit 3e4ed4213d
27 changed files with 339 additions and 38 deletions
+16
View File
@@ -858,6 +858,22 @@ by user and group.
\*[instant-never]
\*[remount-upgrade]
.
.feature com.klarasystems vdev_zaps_v2 no
This feature creates a ZAP object for the root vdev.
.Pp
This feature becomes active after the next
.Nm zpool Cm import
or
.Nm zpool reguid .
.
Properties can be retrieved or set on the root vdev using
.Nm zpool Cm get
and
.Nm zpool Cm set
with
.Sy root
as the vdev name which is an alias for
.Sy root-0 .
.feature org.openzfs zilsaxattr yes extensible_dataset
This feature enables
.Sy xattr Ns = Ns Sy sa