mirror_zfs/cmd/zpool
Brian Behlendorf 3167b0db10 Fix 'zpool add' safety check corner cases
Three cases were discovered where 'zpool add' would fail to
warn when adding vdevs to a pool with a mismatched replication
level.  These are:

  1. When a pool contains mixed file and disk vdevs.
  2. When a pool contains an active dRAID distributed spare
  3. When a pool contains an active hot spare

The lack of warnings are caused by get_replication() assessing
the current pool configuration an inconsistent and disabling
the mismatched replication check for the new pool configuration
after 'zpool add'.  This change updates get_replication() to
be slightly more tolerant in the non-fatal case.

The zpool_add_010_pos.ksh test case was split in to separate
tests: zpool_add_warn_create.ksh, pool_add_warn_degraded.ksh,
and zpool_add_warn_removal.  These test were extended to
include coverage for dRAID pools and the three scenarios
described above.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #17780
2025-10-20 14:56:14 -07:00
..
compatibility.d Add compatibility file for GRUB versions up to v2.06 2024-11-05 15:43:52 -08:00
os GCC 15: Fix unterminated-string-initialization (#17244) 2025-05-27 15:03:11 -07:00
zpool.d zed: misc vdev_enc_sysfs_path fixes 2024-01-29 15:11:56 -08:00
Makefile.am Add compatibility file for GRUB versions up to v2.06 2024-11-05 15:43:52 -08:00
zpool_iter.c zpool: Add slot power control, print power status 2024-01-29 15:12:06 -08:00
zpool_main.c vdev probe to slow disk can stall mmp write checker 2024-04-30 10:01:15 -07:00
zpool_util.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zpool_util.h zpool: Add slot power control, print power status 2024-01-29 15:12:06 -08:00
zpool_vdev.c Fix 'zpool add' safety check corner cases 2025-10-20 14:56:14 -07:00