NetBSD Problem Report #60024
From www@netbsd.org Sat Feb 21 10:08:08 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 "R13" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 6ADD21A923C
for <gnats-bugs@gnats.NetBSD.org>; Sat, 21 Feb 2026 10:08:08 +0000 (UTC)
Message-Id: <20260221100807.5DFDB1A923D@mollari.NetBSD.org>
Date: Sat, 21 Feb 2026 10:08:07 +0000 (UTC)
From: imuwoto@gmail.com
Reply-To: imuwoto@gmail.com
To: gnats-bugs@NetBSD.org
Subject: zfs mount overrides zfs properties like "readonly"
X-Send-Pr-Version: www-1.0
X-From4GNATS: "imuwoto@gmail.com via gnats" <gnats-admin@NetBSD.org>
>Number: 60024
>Category: kern
>Synopsis: zfs mount overrides zfs properties like "readonly"
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: needs-pullups
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Feb 21 10:10:00 +0000 2026
>Closed-Date:
>Last-Modified: Tue Mar 17 00:28:12 +0000 2026
>Originator: YAMAMOTO Takashi
>Release: NetBSD 10.1
>Organization:
>Environment:
amd64
>Description:
see the following example, where readonly=on property is
somehow disabled by a re-mount.
uma# zfs set readonly=on y/tmp
uma# zfs get readonly y/tmp
NAME PROPERTY VALUE SOURCE
y/tmp readonly on local
uma# zfs umount y/tmp
uma# zfs get readonly y/tmp
NAME PROPERTY VALUE SOURCE
y/tmp readonly on local
uma# zfs mount y/tmp
uma# zfs get readonly y/tmp
NAME PROPERTY VALUE SOURCE
y/tmp readonly off temporary
uma#
>How-To-Repeat:
>Fix:
i'm testing this: https://github.com/yamt/netbsd-src/commit/1ba3ad1c41aa1a43de794d27ffaeb817ad58a3c1
>Release-Note:
>Audit-Trail:
From: "YAMAMOTO Takashi" <yamt@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/60024 CVS commit: src/external/cddl/osnet/sys/kern
Date: Sun, 1 Mar 2026 13:52:29 +0000
Module Name: src
Committed By: yamt
Date: Sun Mar 1 13:52:29 UTC 2026
Modified Files:
src/external/cddl/osnet/sys/kern: vfs.c
Log Message:
solaris vfs_optionisset: treat 0 as unspecified
this allows users to leave it default.
before this change, when a user runs "zfs mount -a",
it was processed as "mount them read-write, overriding readonly property".
i don't think it's what the user usually intends.
looking at the illumos code, it seems that mount options there are
basically tri-state. that is, "ro", "rw", and unspecified.
as NetBSD only has a single bit, MNT_RDONLY or !MNT_RDONLY, this commit
maps !MNT_RDONLY to unspecified, which i believe more often matches
the user's intention. it also seems like what illumos does for the legacy
MS_RDONLY bit if i read their code correctly. that is, if MS_RDONLY is set,
it sets MNTOPT_RO. on the other hand, a lack of MS_RDONLY doesn't imply
MNTOPT_RW.
references:
"Temporary Mount Point Properties" section of zfs(8)
PR/60024
https://gnats.netbsd.org/60024
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/cddl/osnet/sys/kern/vfs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->needs-pullups
State-Changed-By: yamt@NetBSD.org
State-Changed-When: Tue, 17 Mar 2026 00:28:12 +0000
State-Changed-Why:
pullup-11.
i haven't investigated earlier branches.
>Unformatted:
(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.