]> git.proxmox.com Git - mirror_zfs.git/commit
Add ashift validation when adding devices to a pool
authorGeorge Wilson <george.wilson@delphix.com>
Fri, 29 Mar 2024 19:15:56 +0000 (15:15 -0400)
committerGitHub <noreply@github.com>
Fri, 29 Mar 2024 19:15:56 +0000 (13:15 -0600)
commitb1e46f869e773086c23c565d7d5b261577023cfb
tree841a192c9d0ec6b0c3dfd60856548322ea225176
parente39e20b6dc73bd7df1f097c23b5297bcc989ed53
Add ashift validation when adding devices to a pool

Currently, zpool add allows users to add top-level vdevs that have
different ashifts but doing so prevents users from being able to
perform a top-level vdev removal. Often times consumers may not realize
that they have mismatched ashifts until the top-level removal fails.

This feature adds ashift validation to the zpool add command and will
fail the operation if the sector size of the specified vdev does not
match the existing pool. This behavior can be disabled by using the -f
flag. In addition, new flags have been added to provide fine-grained
control to disable specific checks. These flags
are:

--allow-in-use
--allow-ashift-mismatch
--allow-replicaton-mismatch

The force flag will disable all of these checks.

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Mark Maybee <mmaybee@delphix.com>
Signed-off-by: George Wilson <gwilson@delphix.com>
Closes #15509
21 files changed:
cmd/zpool/zpool_main.c
cmd/ztest.c
include/libzfs.h
include/sys/fs/zfs.h
include/sys/spa.h
lib/libzfs/libzfs.abi
lib/libzfs/libzfs_pool.c
lib/libzfs/libzfs_util.c
man/man8/zpool-add.8
module/zfs/spa.c
module/zfs/zfs_ioctl.c
tests/runfiles/common.run
tests/zfs-tests/tests/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zpool_add/add-o_ashift.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/add_prop_ashift.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add--allow-ashift-mismatch.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_009_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_010_pos.ksh