From: Mark Johnston <markj@freebsd.org>
To: Christian Schoenebeck <qemu_oss@crudebyte.com>
Cc: qemu-devel@nongnu.org, "Greg Kurz" <groug@kaod.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v2] 9pfs: Add FreeBSD support
Date: Wed, 27 Aug 2025 10:29:37 -0400 [thread overview]
Message-ID: <aK8WUWSIV6Bz526v@nuc> (raw)
In-Reply-To: <12113631.YhV4tvpBIu@silver>
On Tue, Aug 26, 2025 at 02:34:45PM +0200, Christian Schoenebeck wrote:
> On Monday, August 25, 2025 2:53:06 PM CEST Mark Johnston wrote:
> > On Thu, Aug 21, 2025 at 01:24:04PM +0200, Christian Schoenebeck wrote:
> > > On Wednesday, August 6, 2025 7:53:08 PM CEST Mark Johnston wrote:
> [...]
> > > Not forgotten. I just hoped there were other reviewers or testers in the
> > > meantime, but be it.
> > >
> > > Like I said, I don't have FreeBSD system here to test this, so I am taking
> > > your word for now that you tested this and plan to bring this into QEMU
> > > when master re-opens for new features soon.
> >
> > Thank you very much!
> >
> > In case I missed somewhat, what testing would you typically do
> > otherwise? So far I had run the QEMU test suite (which indeed found
> > some bugs in the initial version) and tried mounting a 9pfs share from
> > Linux and FreeBSD guests and doing a bit of manual testing.
>
> Apart from QEMU's test cases, I also use guest systems running 9p as root file
> system [1], run software compilations there among some things. That proofed to
> be quite a useful test environment to spot edge cases, concurrency and
> performance issues and such.
>
> [1] https://wiki.qemu.org/Documentation/9p_root_fs
Thanks, I'll give this a try.
> Greg was running some general purpose file system stress test suite in the
> past, but I currently can't recall what that was.
>
> > > If you have some time to adjust the commit log message above, that would
> > > be
> > > great, otherwise I can also handle this on my end later on. Looks like
> > > that
> > > comment is not adjusted for v2 yet (i.e. "user." and not mentioning
> > > "system.").
> >
> > Here's an amended commit log message. Please let me know if this is
> > better submitted as a v3.
> >
> > commit b79bf1b7d42025e3e14da86a7c08d269038cd3ed
> > Author: Mark Johnston <markj@FreeBSD.org>
> > Date: Wed Jul 16 20:32:05 2025 +0000
> >
> > 9pfs: Add FreeBSD support
> >
> > This is largely derived from existing Darwin support. FreeBSD
> > apparently has better support for *at() system calls so doesn't require
> > workarounds for a missing mknodat(). The implementation has a couple of
> > warts however:
> > - The extattr(2) system calls don't support anything akin to
> > XATTR_CREATE or XATTR_REPLACE, so a racy workaround is implemented.
> > - Attribute names cannot begin with "user." or "system." on ZFS, so
> > these prefixes are trimmed off. FreeBSD's extattr system calls sport
> > an extra "namespace" identifier, and attributes created by the 9pfs
> > backend live in the universal user and system namespaces, so this
> > seems innocent enough.
> >
> > The 9pfs tests were verified to pass on the UFS, ZFS and tmpfs
> > filesystems.
> >
> > Signed-off-by: Mark Johnston <markj@FreeBSD.org>
>
> Almost. Maybe something like this to make it a bit more clear?
>
> - Attribute names cannot begin with "user." or "system." on ZFS. However
> FreeBSD's extattr(2) system supports two dedicated namespaces for these
> two. So "user." or "system." prefixes are trimmed off from attribute
> names and instead EXTATTR_NAMESPACE_USER or EXTATTR_NAMESPACE_SYSTEM
> are picked and passed to extattr system calls instead accordingly.
I folded your suggestion in with a couple of minor tweaks:
commit 61de78986912b03f08354a177caf603857b531b5
Author: Mark Johnston <markj@FreeBSD.org>
Date: Wed Jul 16 20:32:05 2025 +0000
9pfs: Add FreeBSD support
This is largely derived from existing Darwin support. FreeBSD
apparently has better support for *at() system calls so doesn't require
workarounds for a missing mknodat(). The implementation has a couple of
warts however:
- The extattr(2) system calls don't support anything akin to
XATTR_CREATE or XATTR_REPLACE, so a racy workaround is implemented.
- Attribute names cannot begin with "user." or "system." on ZFS.
However FreeBSD's extattr(2) system calls support two dedicated
namespaces for these two. So "user." or "system." prefixes are
trimmed off from attribute names and instead EXTATTR_NAMESPACE_USER or
EXTATTR_NAMESPACE_SYSTEM are picked and passed to extattr system calls
accordingly.
The 9pfs tests were verified to pass on the UFS, ZFS and tmpfs
filesystems.
Signed-off-by: Mark Johnston <markj@FreeBSD.org>
next prev parent reply other threads:[~2025-08-27 14:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-06 17:53 [PATCH v2] 9pfs: Add FreeBSD support Mark Johnston
2025-08-21 11:24 ` Christian Schoenebeck
2025-08-25 12:53 ` Mark Johnston
2025-08-26 12:34 ` Christian Schoenebeck
2025-08-27 14:29 ` Mark Johnston [this message]
2025-09-01 10:31 ` Christian Schoenebeck
2025-09-01 10:40 ` Greg Kurz
2025-09-05 11:19 ` Christian Schoenebeck
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=aK8WUWSIV6Bz526v@nuc \
--to=markj@freebsd.org \
--cc=berrange@redhat.com \
--cc=groug@kaod.org \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu_oss@crudebyte.com \
/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;
as well as URLs for NNTP newsgroup(s).