NetBSD Problem Report #60626

From www@netbsd.org  Thu Aug 20 19:42:59 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)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.netbsd.org", Issuer "YR2" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id F29311A923B
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 20 Aug 2026 19:42:58 +0000 (UTC)
Message-Id: <20260820194257.D2A6D1A923C@mollari.NetBSD.org>
Date: Thu, 20 Aug 2026 19:42:57 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: fss(4): fs type detection
X-Send-Pr-Version: www-1.0
X-From4GNATS: "campbell+netbsd@mumble.net via gnats" <gnats-admin@NetBSD.org>

>Number:         60626
>Category:       kern
>Synopsis:       fss(4): fs type detection
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 20 19:45:02 +0000 2026
>Originator:     Taylor R Campbell
>Release:        current, 11, 10, 9, ...
>Organization:
The NetFstype Detection, Inc.
>Environment:
>Description:

	When /fs is an ffs file system, after

		# fssconfig fss0 /fs /snap

	you can do

		# mount /dev/fss0 /mnt

	and it will just DTRT.

	But if /fs is, say, an lfs file system, the mount won't work:

		# mount /dev/fss0 /mnt
		mount_ffs: /dev/fss0 on /mnt: incorrect super block

	It works for ffs just because mount(8) has a special case: if
	there's no partition type, and there's no : or @ indicating
	nfs, it just assumes ffs.

    293 		/*
    294 		 * If -t flag has not been specified, and spec contains either
    295 		 * a ':' or a '@' then assume that an NFS filesystem is being
    296 		 * specified ala Sun.
    297 		 */
    298 		mntfromname = getfsspecname(buf, sizeof(buf), argv[0]);
    299 		if (mntfromname == NULL)
    300 			err(EXIT_FAILURE, "%s", buf);
    301 		if (vfslist == NULL) {
    302 			if (strpbrk(argv[0], ":@") != NULL) {
    303 				vfstype = "nfs";
    304 			} else {
    305 				vfstype = getfslab(mntfromname);
    306 				if (vfstype == NULL)
    307 					vfstype = ffs_fstype;
    308 			}
    309 		}
    310 		rval = mountfs(vfstype, mntfromname, argv[1], init_flags,
    311 		    options, NULL, 0, NULL, 0);

https://nxr.netbsd.org/xref/src/sbin/mount/mount.c?r=1.108#293

	However, fss(4) must know the type of the file system stored in
	it because it was obtained from a mounted file system with a
	type that can be queried with statvfs(2), giving struct
	statvfs::f_fstypename.

	It would be nice if this could be conveyed to downstream users
	of the /dev/fssN device somehow.  disklabel(8) doesn't work:

		# disklabel fss0
		disklabel: ioctl DIOCGDINFO: Invalid argument

>How-To-Repeat:

	1. fssconfig fss0 <any non-ffs file system>
	2. mount /dev/fss0 /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.