]> git.proxmox.com Git - mirror_zfs.git/commit
Create zap for root vdev
authorrob-wing <98866084+rob-wing@users.noreply.github.com>
Thu, 20 Apr 2023 17:07:56 +0000 (09:07 -0800)
committerGitHub <noreply@github.com>
Thu, 20 Apr 2023 17:07:56 +0000 (10:07 -0700)
commit3e4ed4213d7b4e8892e9def8b06363391d8dbd60
treea2036792648169eb26a80579016900a06dca5bcd
parent71d191ef25d1c60e6725c07b6b94a0184f7db2eb
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
27 files changed:
cmd/zdb/zdb.c
cmd/zpool/zpool_main.c
include/sys/fs/zfs.h
include/sys/vdev_impl.h
include/zfeature_common.h
lib/libzfs/libzfs.abi
lib/libzfs/libzfs_pool.c
lib/libzutil/zutil_import.c
man/man7/zpool-features.7
module/zcommon/zfeature_common.c
module/zfs/spa.c
module/zfs/vdev.c
module/zfs/vdev_label.c
tests/runfiles/common.run
tests/zfs-tests/tests/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zpool_get/vdev_get.cfg [new file with mode: 0644]
tests/zfs-tests/tests/functional/cli_root/zpool_get/vdev_get_001_pos.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get.cfg
tests/zfs-tests/tests/functional/cli_root/zpool_set/vdev_set_001_pos.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps.kshlib
tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_001_pos.ksh
tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_002_pos.ksh
tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_003_pos.ksh
tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_004_pos.ksh
tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_005_pos.ksh
tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_006_pos.ksh
tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_007_pos.ksh