NetBSD Problem Report #60625

From www@netbsd.org  Thu Aug 20 19:32:31 2026
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)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.netbsd.org", Issuer "YR2" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A2D391A923B
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 20 Aug 2026 19:32:31 +0000 (UTC)
Message-Id: <20260820193230.1F5091A923C@mollari.NetBSD.org>
Date: Thu, 20 Aug 2026 19:32:30 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: fss(4): read-only mount quirks
X-Send-Pr-Version: www-1.0
X-From4GNATS: "campbell+netbsd@mumble.net via gnats" <gnats-admin@NetBSD.org>

>Number:         60625
>Category:       kern
>Synopsis:       fss(4): read-only mount quirks
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 20 19:35:00 +0000 2026
>Originator:     Taylor R Campbell
>Release:        current, 11, 10, 9, ...
>Organization:
NetBSD Snapshot Filers LLC
>Environment:
>Description:

	ffs snapshots configured with ffs(4) can be mounted with the
	short command line:

# mount /dev/fss0 /mnt

	However, they are a little quirky:

# touch /mnt/x
touch: /mnt/x: Read-only file system
# umount /mnt
umount: /mnt/x: Read-only file system
# umount /mnt
#

	The touch(1) failure with EROFS is expected, but the _one-time_
	umount(8) failure with EROFS is baffling.

	For lfs, the quirk is a little less benign:

# fssconfig fss0 /lfs /snap
# mount /dev/fss0 /lfs
[ 553.3873306] WARNING: the log-structured file system is experimental
[ 553.3891477] WARNING: it may cause system crashes and/or corrupt data
# mount -t lfs /dev/fss0 /mnt
# umount /mnt
[ 565.8145600] panic: kernel diagnostic assertion "sup->su_nbytes >= osize" failed: file "/home/riastradh/netbsd/current/sys/ufs/lfs/lfs_segment.c", line 602 lfs_updatemeta: negative bytes (segment 1 short by 8192)
[ 565.8145600] lfs_updatemeta: ino 1, lbn 1, addr = 0x4a1

	Stack trace:

kern_assert
lfs_update_single
lfs_updatemeta
lfs_gather
lfs_writefile
lfs_segwrite
lfs_flushfiles
lfs_unmount
VFS_UNMOUNT
dounmount
sys_unmount
syscall

	Perhaps ffs just gets lucky in not even trying to write back to
	the file system.  But lfs should be able to recognize read-only
	media and not try to write back either, and the block device
	/dev/fssN should identify itself as a read-only medium to the
	file system.

>How-To-Repeat:

	ffs:

	1. fssconfig fss0 /ffs /snap
	2. mount /dev/fss0 /mnt
	3. touch /mnt/x
	4. umount /mnt

	lfs:

	1. fssconfig fss0 /lfs /snap
	2. mount /dev/fss0 /mnt
	3. umount /mnt

>Fix:

	Yes, please!

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.