From nobody Fri Nov 11 20:45:25 2022 X-Original-To: geom@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 4N89h56g9xz4g18V for ; Fri, 11 Nov 2022 20:45:25 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N89h53vHzz4T0S for ; Fri, 11 Nov 2022 20:45:25 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668199525; 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: in-reply-to:in-reply-to:references:references; bh=3UcKhk5sUnSkhlZeFNc7VDfaxbb7nA/tu4cy/5YM2oc=; b=avw15S1pwpiz42klz51nlHTej9QQ4IJnY0j5XhWzFjQR18rh7g5vKaatrNb3AwoW1q+7BC A/9WL3YPnaCfIqs/z1p9pisdrX41Xh5zIz9qy/LmnqmJnWHC+z8mIHrXYhb6n7h/G+C9+k 1BCYP2NgHZyawR5ZglX2qOYlV8apOgHecmNYkRMW8hs0rJsdM09xYCQ0wxvVXB+q0bULA6 5Dwrj9fp3N436V/cP4+ZomGdLqQTMaUcDXlbNNCVAxemzElEk3W3R/uVk0M9pyqXcG30jm PYPdcJnprjR4WSYf6oDB5uRjPverVjwh8DRz8CxlIc5zKkGHPL5e/yv7sn5/Wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668199525; a=rsa-sha256; cv=none; b=vzVf6dY27nKu1DLdIwQE2C0kbVxlTxp0WwdBWKKh+JOr4NxLmb3O6f8TMI2H7nqW+RH6V1 JmA8581O15hYJWkoFX0SJRi/LOtmOdsk/1ZY9ewvhuyRdPSKMUGmk4lddrC+DREj1KRbPE RBhrXTZDcrk/BxXAu4JtIin72jMcCyuBwPXCL6MCnpNvALNY2GGdQtcH/0U6BR+aE6fslc 8lPfrbYDkYa8e7tcw3z6QU4LnS0e/wiGsqEpLgympgElDMJfwZbBfn9ysw3haQdkVx03df 1Td3RvlcAXG1IvjWWrmwB3plI7EjUCwGOsbns72Y0kCbmSweuKpAN6ZHgpBdjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4N89h52zRPzx5H for ; Fri, 11 Nov 2022 20:45:25 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 2ABKjPpj030640 for ; Fri, 11 Nov 2022 20:45:25 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2ABKjP2t030639 for geom@FreeBSD.org; Fri, 11 Nov 2022 20:45:25 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: geom@FreeBSD.org Subject: [Bug 241070] dumpon: dumpon opens geom devices non-exclusively Date: Fri, 11 Nov 2022 20:45:25 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: geom@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: GEOM-specific discussions and implementations List-Archive: https://lists.freebsd.org/archives/freebsd-geom List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-geom@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D241070 --- Comment #11 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D11ed0a95bfa76791dc6428eb2d47a986c= 0c6f8a3 commit 11ed0a95bfa76791dc6428eb2d47a986c0c6f8a3 Author: Eric van Gyzen AuthorDate: 2022-11-03 02:42:54 +0000 Commit: Eric van Gyzen CommitDate: 2022-11-11 20:43:47 +0000 zfs tests: stop writing to arbitrary devices TL;DR: Three ZFS tests created ZFS pools on all unmounted devices list= ed in /etc/fstab, corrupting their contents. Stop that. Imagine my surprise when the ESP on my main dev/test VM would "randomly" become corrupted, making it unbootable. Three tests collect various devices from the system and try to add them to a test pool. The test expects t= his to fail because it _assumes_ these devices are in use and ZFS will correctly reject the request. My /etc/fstab has two entries for devices in /dev: /dev/gpt/swap0 none swap sw,trimonce,late /dev/gpt/esp0 /boot/efi msdosfs rw,noauto Note the `noauto` on the ESP. In a remarkable example of irony, I chose this because it should keep the ESP more protected from corruption; in fact, mounting it would have protected it from this case. The tests added all of these devices to a test pool in a _single comman= d_, expecting the command to fail. The swap device was in use, so the comm= and correctly failed, but the ESP was added and therefore corrupted. Howev= er, since the command correctly failed, the test didn't notice the ESP prob= lem. If each device had been added with its own command, the test _might_ ha= ve noticed that one of them incorrectly succeeded. However, two of these tests would not have noticed: hotspare_create_001_neg was incorrectly specified as needing the Solaris dumpadm command, so it was skipped. _Some_ of the test needs that comm= and, but it checks for its presence and runs fine without it. Due to bug 241070, zpool_add_005_pos was marked as an expected failure. Due to the coarse level of integration with ATF, this test would still "pass" even if it failed for the wrong reason. I wrote bug 267554 to reconsider the use of atf_expect_fail in these tests. Let's further consider the use of various devices found around the syst= em. In addition to devices in /etc/fstab, the tests also used mounted devic= es listed by the `mount` command. If ZFS behaves correctly, it will refuse to added mounted devices and swap devices to a pool. However, these are unit tests used by developers to ensure that ZFS still works after they modify it, so it's reasonable to expect ZFS to do the _wrong_ thing sometimes. Using random host devices is unsafe. Fix the root problem by using only the disks provided via the "disks" variable in kyua.conf. Use one to create a UFS file system and mount i= t. Use another as a swap device. Use a third as a dump device, but expect it to fail due to bug 241070. While I'm here: Due to commit 6b6e2954dd65, we can simply add a second dump device and remove it in cleanup. We no longer need to save, replace, and restore = the pre-existing dump device. The cleanup_devices function used `camcontrol inquiry` to distinguish d= isks from other devices, such as partitions. That works fine for SCSI, but = not for ATA or VirtIO block. Use `geom disk list` instead. PR: 241070 PR: 267554 Reviewed by: asomers Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D37257 tests/sys/cddl/zfs/include/libtest.kshlib | 2 +- .../zfs/tests/cli_root/zpool_add/zpool_add.kshlib | 68 ------------------= ---- .../tests/cli_root/zpool_add/zpool_add_005_pos.ksh | 29 ++++++--- .../zfs/tests/cli_root/zpool_add/zpool_add_test.sh | 3 +- .../zfs/tests/hotspare/hotspare_add_003_neg.ksh | 60 +++++++++---------- .../zfs/tests/hotspare/hotspare_create_001_neg.ksh | 60 +++++++++---------- tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh | 4 +- 7 files changed, 83 insertions(+), 143 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=