NetBSD Problem Report #58033

From www@netbsd.org  Tue Mar 12 23:21:54 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 6713B1A923F
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 12 Mar 2024 23:21:54 +0000 (UTC)
Message-Id: <20240312232153.2AE541A9242@mollari.NetBSD.org>
Date: Tue, 12 Mar 2024 23:21:53 +0000 (UTC)
From: naguam@ik.me
Reply-To: naguam@ik.me
To: gnats-bugs@NetBSD.org
Subject: Complete system crash dues to FFSv2 logging.
X-Send-Pr-Version: www-1.0

>Number:         58033
>Category:       kern
>Synopsis:       Complete system crash dues to FFSv2 logging.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 12 23:25:00 +0000 2024
>Last-Modified:  Wed Mar 13 01:25:01 +0000 2024
>Originator:     naguam
>Release:        NetBSD 10 RC5
>Organization:
None
>Environment:
NetBSD i5-1gen.Home 10.0_RC5 NetBSD 10.0_RC5 (GENERIC) #0: Tue Feb 27 05:27:39 UTC 2024  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
Unsafe unplug of an external usb storage volume with the following configuration is causing complete system crash (even ssh stopped working not work).

- 16 GB usb drive with a GPT partition table countaing a single partition.
- That partition, formated  in FFSv2 partition and a 64M WAPBL setup.
- Volume mounted with -o log.

No external DATA storage sudden removal should be able to completely crash the OS. Indeed data loss is expected but not a complete system crash.

Also when writing files, the loss is even worst than without logging (not news though https://mail-index.netbsd.org/tech-kern/2020/07/23/msg026633.html).

>How-To-Repeat:
Step zero: Have a default NetBSD 10 RC5 installation.
(I used the default xdm ctwm x11 environment provided by NetBSD).

Step one: format an external volume (usb drive) in FFSv2 (or 2ea, I tested both).

Step two: (optional) setup custom (bigger) log size such as 64M.

Step three: mount the partition with -o log.

Step four: simulate a power loss by suddenly unplugging the external volume.

Step five: admire the complete freeze and force reboot with the power button.
>Fix:
No idea, but if the FFSv2 log system is not ready, maybe it should not be in the release, as someone could genuinely use it without understanding the risk, as it is considered as a feature right now.

Keeping it into a development branch could be an option.

>Audit-Trail:
From: Taylor R Campbell <riastradh@NetBSD.org>
To: naguam@ik.me
Cc: gnats-bugs@NetBSD.org, netbsd-bugs@NetBSD.org
Subject: Re: kern/58033: Complete system crash dues to FFSv2 logging.
Date: Wed, 13 Mar 2024 01:20:31 +0000

 In general, NetBSD file systems have not (yet) been made resilient to
 forced removal of the underlying storage volume, and may crash.

 This isn't specific to ffsv2 logging; you can reproduce it in ffs
 without logging, or in ext2fs.

 We recommend mounting file systems from external media with `-o rump'
 so they run in userspace and, in the event of removal of the media,
 only crash a userspace process instead of crashing the whole kernel.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.