From: Showta Ishizaki <zakinko@snowrabbit.org>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>, Ali Ahmet Memis <ali@iusegentoo.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Showta Ishizaki <zakinko@snowrabbit.org>
Subject: [PATCH 2/4] ufs: do not take a filesystem NetBSD has mounted for clean
Date: Fri, 27 Nov 2026 14:22:26 +0900 (JST) [thread overview]
Message-ID: <20261127-ufs-suj-2-v1@snowrabbit.org> (raw)
In-Reply-To: <20261127-ufs-suj-0-v1@snowrabbit.org>
NetBSD has fs_clean at 2, FS_WASCLEAN, while a filesystem that was clean
is mounted read-write, so it is what is left after a crash. ufs reads
it as Solaris' "stable" and mounts the filesystem read-write. Mount it
read-only, as one with 0.
Signed-off-by: Showta Ishizaki <zakinko@snowrabbit.org>
---
fs/ufs/super.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index cbb034a87..c204af7ce 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -1135,6 +1135,12 @@ static int ufs_fill_super(struct super_block *sb, struct fs_context *fc)
UFSD("fs is clean\n");
break;
case UFS_FSSTABLE:
+ /* NetBSD's FS_WASCLEAN: mounted, or not unmounted */
+ if ((flags & UFS_ST_MASK) == UFS_ST_44BSD) {
+ pr_err("%s(): fs is active\n", __func__);
+ sb->s_flags |= SB_RDONLY;
+ break;
+ }
UFSD("fs is stable\n");
break;
case UFS_FSLOG:
--
2.54.0 (Apple Git-157)
next prev parent reply other threads:[~2026-11-27 5:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 5:22 [PATCH 0/4] ufs: fs_clean and fs_mtime of a 44bsd filesystem that is read-write Showta Ishizaki
2026-11-27 5:22 ` [PATCH 1/4] ufs: clear fs_clean of a 44bsd filesystem while it " Showta Ishizaki
2026-11-27 5:22 ` Showta Ishizaki [this message]
2026-11-27 5:22 ` [PATCH 3/4] ufs: let FreeBSD see that its soft updates journal is out of date Showta Ishizaki
2026-11-27 5:22 ` [PATCH 4/4] ufs: leave fs_clean of a 44bsd filesystem at 0 after an error Showta Ishizaki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261127-ufs-suj-2-v1@snowrabbit.org \
--to=zakinko@snowrabbit.org \
--cc=ali@iusegentoo.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®