Skip to content

Commit d3297bd

Browse files
author
Paul Dagnelie
committed
Don't try to get mg of hole vdev in removal
Signed-off-by: Paul Dagnelie <[email protected]>
1 parent c43df8b commit d3297bd

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

module/zfs/vdev_removal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ vdev_passivate(vdev_t *vd, uint64_t *txg)
210210
vdev_t *cvd = rvd->vdev_child[id];
211211

212212
if (cvd == vd ||
213-
cvd->vdev_ops == &vdev_indirect_ops)
213+
cvd->vdev_ops == &vdev_indirect_ops ||
214+
cvd->vdev_ops == &vdev_hole_ops)
214215
continue;
215216

216217
metaslab_class_t *mc = cvd->vdev_mg->mg_class;

tests/runfiles/common.run

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,8 @@ tests = ['removal_all_vdev', 'removal_cancel', 'removal_check_space',
888888
'removal_with_send_recv', 'removal_with_snapshot',
889889
'removal_with_write', 'removal_with_zdb', 'remove_expanded',
890890
'remove_mirror', 'remove_mirror_sanity', 'remove_raidz',
891-
'remove_indirect', 'remove_attach_mirror', 'removal_reservation']
891+
'remove_indirect', 'remove_attach_mirror', 'removal_reservation',
892+
'removal_with_hole']
892893
tags = ['functional', 'removal']
893894

894895
[tests/functional/rename_dirs]

tests/zfs-tests/tests/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,6 +1853,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
18531853
functional/removal/removal_with_export.ksh \
18541854
functional/removal/removal_with_faulted.ksh \
18551855
functional/removal/removal_with_ganging.ksh \
1856+
functional/removal/removal_with_hole.ksh \
18561857
functional/removal/removal_with_indirect.ksh \
18571858
functional/removal/removal_with_remove.ksh \
18581859
functional/removal/removal_with_scrub.ksh \
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#! /bin/ksh -p
2+
#
3+
# CDDL HEADER START
4+
#
5+
# This file and its contents are supplied under the terms of the
6+
# Common Development and Distribution License ("CDDL"), version 1.0.
7+
# You may only use this file in accordance with the terms of version
8+
# 1.0 of the CDDL.
9+
#
10+
# A full copy of the text of the CDDL should have accompanied this
11+
# source. A copy of the CDDL is also available via the Internet at
12+
# http://www.illumos.org/license/CDDL.
13+
#
14+
# CDDL HEADER END
15+
#
16+
17+
#
18+
# Copyright (c) 2025 by Klara Inc.
19+
#
20+
21+
. $STF_SUITE/include/libtest.shlib
22+
. $STF_SUITE/tests/functional/removal/removal.kshlib
23+
24+
log_onexit default_cleanup_noexit
25+
DISK1="$(echo $DISKS | cut -d' ' -f1)"
26+
DISK2="$(echo $DISKS | cut -d' ' -f2)"
27+
DISK3="$(echo $DISKS | cut -d' ' -f3)"
28+
29+
log_must zpool create $TESTPOOL $DISK1 log $DISK2
30+
log_must zpool add $TESTPOOL $DISK3
31+
log_must zpool remove $TESTPOOL $DISK2
32+
log_must zpool remove $TESTPOOL $DISK1
33+
34+
log_pass "Removal with a hole as the first other device doesn't panic."

0 commit comments

Comments
 (0)