From nobody Thu Oct 31 14:00:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQcr6nZPz5blR0; Thu, 31 Oct 2024 14:00:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQcr6GR8z41ds; Thu, 31 Oct 2024 14:00:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i21Y1+ZJpP8T3nASTox9bSOX6kVTEgaalBPBNm9Eg90=; b=dK2bW5rqgqObemlf7s4pBgg5gV3EovoOvE/F4lPvHjSH9imLHShZ8VU1Atmy4U8YJNqKK0 KLRgudhAIKGTRAM6Y/KtWsqLlUbn8i5vnSHVzSLBsb0YBTz5fy7eKQaxe1ePJ8btvgrFPR azLAPhXsLT6KCmWgg41C6jvKR5G22cEJ9tfDf4GyIlp+Pw3enr/rLj37buBRdFDGawgxUb jpCYyMCA6G31c0yZtg36bqpXApefg79PBPtNznYbgda37EMvDs06zSqc6l++MC35uNROdN LW840+1bLCc0qsLkVzHHP2OmrODg3MGuhX2al1AooR3kC3zVcCE1kI91kd/1eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i21Y1+ZJpP8T3nASTox9bSOX6kVTEgaalBPBNm9Eg90=; b=szR/CjNH5pEMqIY3w+PJ/rsyggL7pQ9tPm0QTKp2dWIklxtHGcUOPUGgI/+FvL7VckrlfL VXu+GQUryB8I92s0pi7AFlcyKoqPQTCt4uGzAdKwoCmPaGZNGbwHEO/30yOH0hGsRfhcwN VXlB8o0w+VN/sFhi8UWIKy1kVe5wg+f+9K4UTi5fd7zqPpvzKzTh987qnJmv3DlpO4tPuU jKBbf1rBV+/zYX4khIJ/SJvMbtqjvTb0b0Fr+aMUD6YjQuBnxC/9rf8cVKBTcX7wU8d9NZ iAupoSBudPi2B8cEMdiGoitKh/TOVwxMsnJvYEA4HyY8t4Qmke5DpD8sdsUrhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383244; a=rsa-sha256; cv=none; b=uERw0i0hWjb8m4tZ8YpKoNjldvtsXoYxVgaX4DNpckWQxwez5BH4CuTw9hU95IX4G+52FT WQAtmtLijuNJWHaSiHGw1tVgM8CammJcYz7JF8Ymg9kTe5nN0OzaG+aRGRzq0+K3oHBKKt 62yb49hAQS5ByZxzGIWYpTBt0E5DTejRd3rzQtY/qIp1hEq7Odb6H5ZrqGPalpraA6ofnc n+IjWTpdPMpG7u3AJw1DW+ub6BkrtNUJCBY/DR5MXK2n+VSfFfv1yl9AjuwKLfoUbh1CVn puE18S/eWPyiEbugRL2rc69IrUjMNquumdNygPhGw3l4bYqn3EPpnwhdK7ajQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQcr5ssqzf6y; Thu, 31 Oct 2024 14:00:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VE0iN9040584; Thu, 31 Oct 2024 14:00:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VE0ij5040581; Thu, 31 Oct 2024 14:00:44 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:00:44 GMT Message-Id: <202410311400.49VE0ij5040581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: d3459fe7f737 - stable/14 - zfsd: replace vdevs with the AUX faulted state List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d3459fe7f737f7168992e833fdad7d3aa1f01bc9 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=d3459fe7f737f7168992e833fdad7d3aa1f01bc9 commit d3459fe7f737f7168992e833fdad7d3aa1f01bc9 Author: Alan Somers AuthorDate: 2024-10-03 21:54:28 +0000 Commit: Alan Somers CommitDate: 2024-10-31 14:00:32 +0000 zfsd: replace vdevs with the AUX faulted state Without this patch, vdevs faulted via AUX state would not be replaced once the appropriate drive is replaced. ZFS does not internally use that state, but a drive can be manually forced into such a state with a command like zinject. Submitted by: Goran Mekić Sponsored by: ConnectWise Differential Revision: https://reviews.freebsd.org/D46866 (cherry picked from commit 618ae939b7f95a197a0518cbb390a572bb90c6d0) --- cddl/usr.sbin/zfsd/case_file.cc | 2 +- tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib | 2 +- .../zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh | 26 +++++++++++++--------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/cddl/usr.sbin/zfsd/case_file.cc b/cddl/usr.sbin/zfsd/case_file.cc index f9fd84da7277..7adfb08b75c6 100644 --- a/cddl/usr.sbin/zfsd/case_file.cc +++ b/cddl/usr.sbin/zfsd/case_file.cc @@ -288,7 +288,7 @@ CaseFile::ReEvaluate(const string &devPath, const string &physPath, Vdev *vdev) return (/*consumed*/false); } - if (VdevState() > VDEV_STATE_CANT_OPEN) { + if (VdevState() > VDEV_STATE_FAULTED) { /* * For now, newly discovered devices only help for * devices that are missing. In the future, we might diff --git a/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib b/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib index a4a7ef80ed9f..6369387ba069 100644 --- a/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib +++ b/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib @@ -52,7 +52,7 @@ function wait_for_pool_dev_state_change function wait_for_pool_removal { typeset -i timeout=$1 - wait_for_pool_dev_state_change $timeout $REMOVAL_DISK "REMOVED|UNAVAIL" + wait_for_pool_dev_state_change $timeout $REMOVAL_DISK "REMOVED|UNAVAIL|FAULTED" } function wait_until_scrubbed diff --git a/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh b/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh index 4eb04d60809e..7ad7a9113402 100644 --- a/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh +++ b/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh @@ -83,19 +83,25 @@ typeset SPARE_NOP=${DISK4}.nop typeset OTHER_DISKS="${DISK1} ${DISK2}" typeset OTHER_NOPS=${OTHER_DISKS//~(E)([[:space:]]+|$)/.nop\1} set -A MY_KEYWORDS "mirror" "raidz1" "raidz2" +set -A MY_FAILURES "FAULTED" "REMOVED" ensure_zfsd_running log_must create_gnops $OTHER_DISKS $SPARE_DISK -for keyword in "${MY_KEYWORDS[@]}" ; do - log_must create_gnop $REMOVAL_DISK $PHYSPATH - log_must create_pool $TESTPOOL $keyword $REMOVAL_NOP $OTHER_NOPS spare $SPARE_NOP - log_must $ZPOOL set autoreplace=on $TESTPOOL +for failure in "${MY_FAILURES[@]}" ; do + for keyword in "${MY_KEYWORDS[@]}" ; do + log_must create_gnop $REMOVAL_DISK $PHYSPATH + log_must create_pool $TESTPOOL $keyword $REMOVAL_NOP $OTHER_NOPS spare $SPARE_NOP + log_must $ZPOOL set autoreplace=on $TESTPOOL - log_must destroy_gnop $REMOVAL_DISK - log_must wait_for_pool_removal 20 - log_must create_gnop $NEW_DISK $PHYSPATH - verify_assertion - destroy_pool "$TESTPOOL" - log_must destroy_gnop $NEW_DISK + if [ $failure = "FAULTED" ]; then + log_must zinject -d $REMOVAL_NOP -A fault $TESTPOOL + fi + log_must destroy_gnop $REMOVAL_DISK + log_must wait_for_pool_removal 20 + log_must create_gnop $NEW_DISK $PHYSPATH + verify_assertion + destroy_pool "$TESTPOOL" + log_must destroy_gnop $NEW_DISK + done done log_pass