From nobody Tue Jun 15 13:13:39 2021 X-Original-To: fs@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 2B0BF5D5D38 for ; Tue, 15 Jun 2021 13:13:39 +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 4G48030gPmz3mbR for ; Tue, 15 Jun 2021 13:13:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 0063987C for ; Tue, 15 Jun 2021 13:13:39 +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 15FDDcVI075782 for ; Tue, 15 Jun 2021 13:13:38 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 15FDDcJb075781 for fs@FreeBSD.org; Tue, 15 Jun 2021 13:13:38 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: fs@FreeBSD.org Subject: [Bug 256511] UFS assertion failure when shutting down from single-user mode Date: Tue, 15 Jun 2021 13:13:39 +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 Only Me X-Bugzilla-Who: rew@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: fs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created 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: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D256511 Robert Wing changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rew@FreeBSD.org --- Comment #4 from Robert Wing --- Created attachment 225827 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D225827&action= =3Dedit fix panic on shutdown There appears to be a couple issues here: One issue is /dev/gpt/rootfs vs gpt/rootfs. The second is that the soft dependency code doesn't properly clean up after a namei lookup failure. At the mountroot prompt, devfs is mounted on the root so the namei lookup= =20=20=20=20=20=20 for 'gpt/rootfs' works. devfs is then remounted to /dev and the init process begins.=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20 Then comes time to mount 'gpt/rootfs', but devfs is no longer at the root, so the namei lookup fails. The system then drops into single-user mode with a readonly filesystem.=20= =20=20=20=20=20=20=20=20 The panic is caused because the soft dependency code gets set up (via softdep_mount()), but doesn't clean up after itself following the namei loo= kup failure (in ffs_mount()). The lookup failure causes the filesystem to not g= et mounted 'rw' (i.e., without soft updates). On shutdown, the system doesn't recognize that the filesystem is mounted with soft updates (because it isn'= t), and skips the clean up code (being softdep_unmount()). By skipping the clea= n-up clode, ump->um_softdep doesn't get set to NULL and fails on `MPASS()`.=20= =20=20=20=20=20=20=20=20=20 /dev/gpt/rootfs works at the mountprompt because when devfs is mounted on t= he root, a symlink is also created for '/dev' that points to '/'.=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 I've attached a patched that fixes the panic - on its own, it doesn't addre= ss the real problem.=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 I think the real problem is that if the namei lookup succeeds at the mountprompt, then namei should also succeed when it tries to mount the root filesystem 'rw'. One solution might be to prefix '/dev/' to the device stri= ng if its passed to the mountprompt without it..?=20 Any thoughts? --=20 You are receiving this mail because: You are the assignee for the bug.=