NetBSD Problem Report #58902

From www@netbsd.org  Fri Dec 13 22:40:57 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)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 9DFF81A923C
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 13 Dec 2024 22:40:57 +0000 (UTC)
Message-Id: <20241213224056.747631A923D@mollari.NetBSD.org>
Date: Fri, 13 Dec 2024 22:40:56 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: ffs ignores fs_id
X-Send-Pr-Version: www-1.0

>Number:         58902
>Category:       kern
>Synopsis:       ffs ignores fs_id
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 13 22:45:00 +0000 2024
>Originator:     Taylor R Campbell
>Release:        current, 10, 9, ...
>Organization:
The NetBSD Ffsidentification
>Environment:
>Description:
Both FreeBSD and OpenBSD use the `fs_id' field of the ffs superblock to initialize the fsid which figures into NFS exports so that they aren't affected by the order of device enumeration or anything like that (PR kern/58901: nfs server should allow specifying fsid in exports(5), https://gnats.netbsd.org/58901).  They adopted this in 1997 around the same time as fsirand(8) and inode randomization, but for some reason although we adopted fsirand(8) and eventually taught newfs(8) to initialize fs_id, we missed the part where the kernel uses it as the fsid for fhandles.

As a result, even though the ffs on-disk format natively supports persistent stable fsid values, our nfs server fails to use them and instead depends on device enumeration order so it's unstable under dkN renumbering.
>How-To-Repeat:
export ffs on dkN through nfs, reboot with different dkN numbering
>Fix:
Yes, please!

1. Teach ffs_vfsops.c to use struct fs::fs_id.
2. Put a prominent notice in release notes about nfs clients and stale file handles.

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.