Skip to content

Don't try to get mg of hole vdev in removal #17080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions module/zfs/vdev_removal.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ vdev_passivate(vdev_t *vd, uint64_t *txg)
for (uint64_t id = 0; id < rvd->vdev_children; id++) {
vdev_t *cvd = rvd->vdev_child[id];

if (cvd == vd ||
cvd->vdev_ops == &vdev_indirect_ops)
if (cvd == vd || !vdev_is_concrete(cvd) ||
vdev_is_dead(cvd))
continue;

metaslab_class_t *mc = cvd->vdev_mg->mg_class;
Expand Down
3 changes: 2 additions & 1 deletion tests/runfiles/common.run
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,8 @@ tests = ['removal_all_vdev', 'removal_cancel', 'removal_check_space',
'removal_with_send_recv', 'removal_with_snapshot',
'removal_with_write', 'removal_with_zdb', 'remove_expanded',
'remove_mirror', 'remove_mirror_sanity', 'remove_raidz',
'remove_indirect', 'remove_attach_mirror', 'removal_reservation']
'remove_indirect', 'remove_attach_mirror', 'removal_reservation',
'removal_with_hole']
tags = ['functional', 'removal']

[tests/functional/rename_dirs]
Expand Down
1 change: 1 addition & 0 deletions tests/zfs-tests/tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -1853,6 +1853,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/removal/removal_with_export.ksh \
functional/removal/removal_with_faulted.ksh \
functional/removal/removal_with_ganging.ksh \
functional/removal/removal_with_hole.ksh \
functional/removal/removal_with_indirect.ksh \
functional/removal/removal_with_remove.ksh \
functional/removal/removal_with_scrub.ksh \
Expand Down
34 changes: 34 additions & 0 deletions tests/zfs-tests/tests/functional/removal/removal_with_hole.ksh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#! /bin/ksh -p
#
# CDDL HEADER START
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
# CDDL HEADER END
#

#
# Copyright (c) 2025 by Klara Inc.
#

. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/removal/removal.kshlib

log_onexit default_cleanup_noexit
DISK1="$(echo $DISKS | cut -d' ' -f1)"
DISK2="$(echo $DISKS | cut -d' ' -f2)"
DISK3="$(echo $DISKS | cut -d' ' -f3)"

log_must zpool create $TESTPOOL $DISK1 log $DISK2
log_must zpool add $TESTPOOL $DISK3
log_must zpool remove $TESTPOOL $DISK2
log_must zpool remove $TESTPOOL $DISK1

log_pass "Removal with a hole as the first other device doesn't panic."
Loading