kern/60625: fss(4): read-only mount quirks

"[email protected] via gnats" <[email protected]>
Newsgroups gmane.os.netbsd.bugs
Message-ID <[email protected]>
>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!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.