Date: Tue, 15 Jun 2021 13:13:39 +0000 From: bugzilla-noreply@freebsd.org To: fs@FreeBSD.org Subject: [Bug 256511] UFS assertion failure when shutting down from single-user mode Message-ID: <bug-256511-3630-fU2Vub4RV0@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-256511-3630@https.bugs.freebsd.org/bugzilla/> References: <bug-256511-3630@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D256511 Robert Wing <rew@FreeBSD.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rew@FreeBSD.org --- Comment #4 from Robert Wing <rew@FreeBSD.org> --- 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.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-256511-3630-fU2Vub4RV0>