Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Mar 2024 21:25:00 GMT
From:      Chuck Silvers <chs@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 083608e4669e - stable/13 - UFS: panic rather than forcibly unmount the root fs
Message-ID:  <202403202125.42KLP0TO029914@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by chs:

URL: https://cgit.FreeBSD.org/src/commit/?id=083608e4669e0eb3d31d4e7d9ced00ae822807e6

commit 083608e4669e0eb3d31d4e7d9ced00ae822807e6
Author:     Chuck Silvers <chs@FreeBSD.org>
AuthorDate: 2023-08-10 16:55:47 +0000
Commit:     Chuck Silvers <chs@FreeBSD.org>
CommitDate: 2024-03-20 20:25:49 +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.
    
    PR:             276944
    Requested-by:   karels
    Reviewed-by:    imp, mckusick, karels
    Sponsored-by:   Netflix
    Differential Revision:  https://reviews.freebsd.org/D41387
    
    (cherry picked from commit 60a41168d195cc09f7351c2c2bcafc389ed52406)
---
 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 a7c619fe98ef..433df476f563 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -324,6 +324,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.
 		 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202403202125.42KLP0TO029914>