Ignore pool ashift property during vdev attachment
commitd8011707ccb0fa1ba551777923893a137bd198d8
authorAmeer Hamza <ahamza@ixsystems.com>
Thu, 20 Jul 2023 16:57:16 +0000 (20 21:57 +0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 21 Jul 2023 23:35:12 +0000 (21 16:35 -0700)
treeeccc1ef8fbeab0c4800538001592b49137ff1a4e
parentf5f5a2db9544bb09e14db47936b985264eb0ff87
Ignore pool ashift property during vdev attachment

Ashift can be set for a vdev only during its creation, and the
top-level vdev does not change when a vdev is attached or replaced.
The ashift property should not be used during attachment, as it
does not allow attaching/replacing a vdev if the pool's ashift
property is increased after the existing vdev was created. Instead,
we should be able to attach the vdev if the attached vdev can
satisfy the ashift requirement with its parent.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #15061
include/sys/vdev_impl.h
module/zfs/vdev.c
tests/zfs-tests/tests/functional/cli_root/zpool_attach/attach-o_ashift.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace-o_ashift.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace_prop_ashift.ksh