From owner-dev-commits-src-all@freebsd.org Thu Jun 17 18:39:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 42050657939; Thu, 17 Jun 2021 18:39:34 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G5W7B1Q9Zz3Qp5; Thu, 17 Jun 2021 18:39:34 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 0D5C71483E; Thu, 17 Jun 2021 18:39:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15HIdXdv003481; Thu, 17 Jun 2021 18:39:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15HIdXUk003480; Thu, 17 Jun 2021 18:39:33 GMT (envelope-from git) Date: Thu, 17 Jun 2021 18:39:33 GMT Message-Id: <202106171839.15HIdXUk003480@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: ee3a7246c65c - stable/13 - gmultipath: make physpath distinct from the underlying providers' 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/13 X-Git-Reftype: branch X-Git-Commit: ee3a7246c65ceb2fdcfcf8d337dbdeaa315a332d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2021 18:39:34 -0000 The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=ee3a7246c65ceb2fdcfcf8d337dbdeaa315a332d commit ee3a7246c65ceb2fdcfcf8d337dbdeaa315a332d Author: Alan Somers AuthorDate: 2021-04-22 21:09:03 +0000 Commit: Alan Somers CommitDate: 2021-06-17 18:39:14 +0000 gmultipath: make physpath distinct from the underlying providers' zfsd uses a device's physical path attribute to automatically replace a missing ZFS disk when a blank disk is inserted into the same physical slot. Currently gmultipath passes through its underlying providers' physical path attribute. That may cause zfsd to replace a missing gmultipath provider with a newly arrived, single-path disk. That would be bad. This commit fixes that problem by simply appending "/mp" to the underlying providers' physical path, in a manner similar to what geli already does. Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D29941 (cherry picked from commit 420dbe763f15b076751443edfeeb4f676deb3c44) --- sys/geom/multipath/g_multipath.c | 6 ++++++ tests/sys/geom/class/multipath/misc.sh | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/geom/multipath/g_multipath.c b/sys/geom/multipath/g_multipath.c index 5972b63e680a..120fced0a8f1 100644 --- a/sys/geom/multipath/g_multipath.c +++ b/sys/geom/multipath/g_multipath.c @@ -394,6 +394,12 @@ g_multipath_done(struct bio *bp) mtx_unlock(&sc->sc_mtx); } else mtx_unlock(&sc->sc_mtx); + if (bp->bio_error == 0 && + bp->bio_cmd == BIO_GETATTR && + !strcmp(bp->bio_attribute, "GEOM::physpath")) + { + strlcat(bp->bio_data, "/mp", bp->bio_length); + } g_std_done(bp); } } diff --git a/tests/sys/geom/class/multipath/misc.sh b/tests/sys/geom/class/multipath/misc.sh index 583434e1cfa5..4da8462588ca 100755 --- a/tests/sys/geom/class/multipath/misc.sh +++ b/tests/sys/geom/class/multipath/misc.sh @@ -198,7 +198,7 @@ fail_on_error_cleanup() atf_test_case physpath cleanup physpath_head() { - atf_set "descr" "gmultipath should pass through the underlying providers' physical path" + atf_set "descr" "gmultipath should append /mp to the underlying providers' physical path" atf_set "require.user" "root" } physpath_body() @@ -217,7 +217,7 @@ physpath_body() atf_check gnop create -z $physpath /dev/${md1} atf_check -s exit:0 gmultipath create "$name" ${md0}.nop ${md1}.nop gmultipath_physpath=$(diskinfo -p multipath/"$name") - atf_check_equal "$physpath" "$gmultipath_physpath" + atf_check_equal "$physpath/mp" "$gmultipath_physpath" } physpath_cleanup() {