From nobody Thu Aug 10 17:05:04 2023 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 4RMCwK25pmz4pm80; Thu, 10 Aug 2023 17:05:05 +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 4RMCwK1GvJz4N2x; Thu, 10 Aug 2023 17:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691687105; 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=6DOU8i8F6mnsQTusoNTwrfzIPKE/FMRmVVFfYHqHf+k=; b=j1jFkmlo2Y6MC8TJ/fkOpIp/FK9HfAwkyL1mkg34Ee2xuFHSTUrEuBhZGToUfcUENmr/ff SbNzpStA3MaK2g9WencGrn5YgsmGI8pXnxGqMlVqCwNyugscALTpWBfUKaG4YJ3pTKS1WU AfElls4OuWAIVpnul9vwcbiY1u9vwk+X5lH0faum5WxepVZVdwzODTmrQOmepcWpKeT8Ji 2aw7RSiDT1eNGHJshQhx5gZmG2btuXBiY0DVZN4DFApwe6h9zNHxbkZWbpQHX5mtE9gIxo h+LJEMLBYj79E+VrzwAbMeWHsRQLCZbRbLJiNSUlVGkbI8yq7obWzth1Oef6Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691687105; 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=6DOU8i8F6mnsQTusoNTwrfzIPKE/FMRmVVFfYHqHf+k=; b=FDyMFl54GzX4TrZuYo1SN1NJurNPRgp7JYkAxctxnA6Qe5JC/pPFDR5nlYTB34r6otqwAD FReRuJL4M1jf5+yYEq6rdWLQBzVDs3BfjqGFMMXic6gRYikQJA3vWD3jckKIIV5SP3UNQc 6ByyOgfNPc5tc5xUkdQwt7/A0K4UncBuwW2zjXYY76L3H1rFJq4xJrllPZFinUXM83SPyH 4RoIBC57ZlvJklCRWwbA6DuXl0PhOnICfrKCvlfZLTgx30hHA2hV8O+c0sxjj7p1et9RI2 6xqdixYV5XIeYy2xnRODcsA712oC48GTaXKXLKKMWE4hohnHunQj1j376Oe0jQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691687105; a=rsa-sha256; cv=none; b=XOSrFruk0/6vOADBaQcHqsAB79C+QTlTjt9v2XGoTWm17KqSSGA73wG/c8+L5toqY36QCu vQuo6dbhxuRPaHwQxECRLnnhOYvSukAbLOKMf6ybaXO0z2SULSOkb92S2KOipNMemoxzVK vFRb0jO/IETXAiBM/eQYIFS5/Xzs3U1YcyIxm4HC7zJEhUduzoQdwldaqj2bXA/1EuMavE GJOPjL3KHKNR06uRro4gfUL3LDig2lq+CP5he75Xh7bZqsfL19Z4b/8VDnqGiUJQP/yNd0 zQYc+He06qDYaXF6pLJlpB0TycJcwiUHfFxG0X/6zvvGLu7Lbz9UJV6w035yIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RMCwK0KG5z14rq; Thu, 10 Aug 2023 17:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37AH54js094049; Thu, 10 Aug 2023 17:05:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37AH54K0094046; Thu, 10 Aug 2023 17:05:04 GMT (envelope-from git) Date: Thu, 10 Aug 2023 17:05:04 GMT Message-Id: <202308101705.37AH54K0094046@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Chuck Silvers Subject: git: 60a41168d195 - main - UFS: panic rather than forcibly unmount the root fs 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: chs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 60a41168d195cc09f7351c2c2bcafc389ed52406 Auto-Submitted: auto-generated The branch main has been updated by chs: URL: https://cgit.FreeBSD.org/src/commit/?id=60a41168d195cc09f7351c2c2bcafc389ed52406 commit 60a41168d195cc09f7351c2c2bcafc389ed52406 Author: Chuck Silvers AuthorDate: 2023-08-10 16:55:47 +0000 Commit: Chuck Silvers CommitDate: 2023-08-10 16:59:06 +0000 UFS: panic rather than forcibly unmount the root fs If the root fs is forcibly unmounted then basically every process will die with a SEGV as soon as it tries to run again because libc.so is gone, which leaves the system basically hung. It seems better to just panic instead, so let's do that. Requested-by: karels Reviewed-by: imp, mckusick, karels Sponsored-by: Netflix Differential Revision: https://reviews.freebsd.org/D41387 --- sys/ufs/ffs/ffs_vfsops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 64236d4e98d9..b2cd2d30bc04 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -303,6 +303,9 @@ ffs_fsfail_cleanup_locked(struct ufsmount *ump, int error) mtx_assert(UFS_MTX(ump), MA_OWNED); if (error == ENXIO && (ump->um_flags & UM_FSFAIL_CLEANUP) == 0) { ump->um_flags |= UM_FSFAIL_CLEANUP; + if (ump->um_mountp == rootvnode->v_mount) + panic("UFS: root fs would be forcibly unmounted"); + /* * Queue an async forced unmount. */