From nobody Sat Nov 19 17:42:09 2022 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 4NF1Dx4LHqz4hS02; Sat, 19 Nov 2022 17:42:09 +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 4NF1Dx3DJbz43WZ; Sat, 19 Nov 2022 17:42:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668879729; 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=l3CsCWWW4sboOXnRRTYbCdE1uDOa3oB8sNVYC7rF7LQ=; b=PyubTESDSbekyzqwE/Fvqf9VKhoTZi89H29THq5vcW6NK7VrkbszleBo8fIhv7QY/wxTU5 5omLlWP1wrYs6TvEMvZwrcI9Rxpz1snwMvvDhN967Tbsdy/fqLU43YV/FB+SY2YkvBu8HQ mAv4q7HxexboHKw6KiJSZn4XWO4mjvilEU+EnpYcK1hdqR0BVYl7Aesx5tFSd9UFx/nIMD FqF24IWltTh5l/x4VECQy+oIVLG+eAXzmLIav7OqUTisgLu7nxUHRzRm6bmMv+YQrcwUR9 63ngyoTmWx9RsZDa+71gLIjgF+txZmerpdTfhkvXwdgkJSpWtzSpwgfv7rWeyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668879729; 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=l3CsCWWW4sboOXnRRTYbCdE1uDOa3oB8sNVYC7rF7LQ=; b=afJ4DKHooPwGg74e36rvqaz27nn8FK4wA5OQLHhgEICSgRJAeJIFHYo4WdvkH4U+gPscAx 72ykuRP8g069XRDYzvTH49i72vw8X/XC6wKg+spFS64adazTlmcVKTKKN7d55lrKVMEjUd Ig6iPR28fV1MP3mKbIbw63BX7ankzBsq/hDQ5wWqcBDNNtouCU2rifoupoPP1uatSPVNvV 4YWL7Cs5heKLLyytDKzddLJjPFMoQxAg4QInY5qMAg+pa9uOezlZuGAAtyJWdGIsKZd5FA zOh7PXDh0OyWXPR6YFkvVM9XkvLwmCc4A70rjnBdAfkCIYoWxOyEYZ19C4ULOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668879729; a=rsa-sha256; cv=none; b=uebTgMJX5gkT9YEjB0i6zQrZhlWuB+pO1T0e4kU829b40z90joaNuuUUJu5Bi0jRX0adT+ JSG6SglzWBbkuKJoPuQQ9NblU83UVH6jQa5Zh+mAnEYM8NnwyzY0K9UHaDg55Xu6A/M7OV ANbV/T3fv/Uj2/TYqF/tmvkvDpLtruEHpWWD1we7hAIbxYtC51WTCPId2TKeQq1o0jmnvc L1eeE3M5PJnUsB6yPkkxr7i5w7p/uPe2Z1RWUY6Gr/9cOY57hwI3ulGkvMT/8O59ydJNrT nC7WJ1srOvcOvC6hFLNK+rJjP9WlkYUGGqmHrKRZwt8IiIBlUbVIvMEiBIvZJg== 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 4NF1Dx2CgRztTR; Sat, 19 Nov 2022 17:42:09 +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 2AJHg9j2023807; Sat, 19 Nov 2022 17:42:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AJHg9Qc023806; Sat, 19 Nov 2022 17:42:09 GMT (envelope-from git) Date: Sat, 19 Nov 2022 17:42:09 GMT Message-Id: <202211191742.2AJHg9Qc023806@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Chuck Tuffli Subject: git: d878a66a9a77 - stable/13 - wait for device mounts in zpool and dumpon 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: chuck X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d878a66a9a77fc67801000bfab8fa77b2b3faecc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by chuck: URL: https://cgit.FreeBSD.org/src/commit/?id=d878a66a9a77fc67801000bfab8fa77b2b3faecc commit d878a66a9a77fc67801000bfab8fa77b2b3faecc Author: Chuck Tuffli AuthorDate: 2021-03-05 16:13:23 +0000 Commit: Chuck Tuffli CommitDate: 2022-11-19 17:40:48 +0000 wait for device mounts in zpool and dumpon If the root file system is composed from multiple devices, wait for devices to be ready before running zpool and dumpon rc scripts. An example of this is if the bulk of the root file system exists on a fast device (e.g. NVMe) but the /var directory comes from a ZFS dataset on a slower device (e.g. SATA). In this case, it is possible that the zpool import may run before the slower device has finished being probed, leaving the system in an intermediate state. Fix is to add root_hold_wait to the zpool and dumpon (which has a similar issue) rc scripts. PR: 242189 (cherry picked from commit f30f11f878fe2aa535cd286810d31c92793a3d95) --- libexec/rc/rc.d/dumpon | 2 ++ libexec/rc/rc.d/zpool | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/dumpon b/libexec/rc/rc.d/dumpon index a1132c78da68..6ca335b73842 100755 --- a/libexec/rc/rc.d/dumpon +++ b/libexec/rc/rc.d/dumpon @@ -55,6 +55,7 @@ dumpon_start() [Nn][Oo] | '') ;; [Aa][Uu][Tt][Oo]) + root_hold_wait dev=$(/bin/kenv -q dumpdev) if [ -n "${dev}" ] ; then dumpon_try "${dev}" @@ -75,6 +76,7 @@ dumpon_start() return 1 ;; *) + root_hold_wait dumpon_try "${dumpdev}" ;; esac diff --git a/libexec/rc/rc.d/zpool b/libexec/rc/rc.d/zpool index f98693f2cb13..e73c2b7e5b73 100755 --- a/libexec/rc/rc.d/zpool +++ b/libexec/rc/rc.d/zpool @@ -22,7 +22,14 @@ zpool_start() for cachefile in /etc/zfs/zpool.cache /boot/zfs/zpool.cache; do if [ -r $cachefile ]; then - zpool import -c $cachefile -a -N && break + zpool import -c $cachefile -a -N + if [ $? -ne 0 ]; then + echo "Import of zpool cache ${cachefile} failed," \ + "will retry after root mount hold release" + root_hold_wait + zpool import -c $cachefile -a -N + fi + break fi done }