All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus@codewreck.org>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Eric Sandeen <sandeen@redhat.com>,
	v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, ericvh@kernel.org,
	lucho@ionkov.net, linux_oss@crudebyte.com, eadavis@qq.com
Subject: Re: [PATCH V3 4/4] 9p: convert to the new mount API
Date: Tue, 14 Oct 2025 04:04:12 +0900	[thread overview]
Message-ID: <aO1NLCI3kIdgWcvh@codewreck.org> (raw)
In-Reply-To: <bc86b13e-1252-4bf0-86f9-77da37f5e37a@sandeen.net>

Eric Sandeen wrote on Mon, Oct 13, 2025 at 01:46:42PM -0500:
> > ... Which turned out to be needed right away, trying with qemu's 9p
> > export "mount -t 9p -o trans=virtio tmp /mnt" apparently calls
> > p9_virtio_create() with fc->source == NULL, instead of the expected
> > "tmp" string
> > (FWIW I tried '-o trans=tcp 127.0.0.1' and I got the same problem in
> > p9_fd_create_tcp(), might be easier to test with diod if that's what you
> > used)
> 
> I swear I tested this, but you are right, and it fails for me too.
> 
> Oh ... I know what this is :(
> 
> Introducing the "ignore unknown mount options" change in V4 caused it to
> also ignore the unknown "source" option and report success; this made the
> vfs think "source" was already handled in vfs_parse_fs_param() and
> therefore it does not call vfs_parse_fs_param_source(). This has bitten
> me before and it's a bit confusing.
> 
> I'm not sure how I missed this in my V4 testing, I'm very sorry.

No harm done :)

And thanks for the explanation, the vfs parsing being done only if the
fs-specific parsing failed was far from obvious for me!

> > Looking at other filesystems (e.g. fs/nfs/fs_context.c but others are
> > the same) it looks like they all define a fsparam_string "source" option
> > explicitly?...
> 
> Not all of them; filesystems that reject unknown options have "source"
> handled for them in the VFS, but for filesystems like debugfs that
> ignore unknown parameters it had to handle it explicitly. (Other
> filesystems may do so for other reasons I suppose).
> 
> See also a20971c18752 which fixed a20971c18752, though the bug had
> slightly less of an impact.

(I assume the former was 3a987b88a425)

> Yep, this looks correct, I think. It essentially "steals" the string from
> the param and sets it in fc->source since the VFS won't do it for us.

Yes, I copied that from nfs and it looks like debugfs does the same.

> I can't help but feel like there's maybe a better treewide fix for this
> to make it all a bit less opaque, but for now this is what other
> filesystems do, and so I think this is the right fix for my series at
> this point.

Not much better given it does the work twice but we could return -EINVAL
in the case Opt_source statement to optimize for code size...
I'm not sure that's quite clearer though, I'll stick to "doing what
everyone else" does for now and we/someone can revisit this later.

> Would you like me to send an updated patch with this change, or will you
> just fix it on your end?

Happy to roll it in directly, I'll reply again when I find time to
finish testing and push to next.
-- 
Dominique Martinet | Asmadeus

  reply	other threads:[~2025-10-13 19:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-10 21:36 [PATCH V3 0/4] 9p: Convert to the new mount API Eric Sandeen
2025-10-10 21:36 ` [PATCH V3 1/4] fs/fs_parse: add back fsparam_u32hex Eric Sandeen
2025-10-10 21:36 ` [PATCH V3 2/4] net/9p: move structures and macros to header files Eric Sandeen
2025-10-10 21:36 ` [PATCH V3 3/4] 9p: create a v9fs_context structure to hold parsed options Eric Sandeen
2025-10-10 21:36 ` [PATCH V3 4/4] 9p: convert to the new mount API Eric Sandeen
2025-10-13 10:26   ` Dominique Martinet
2025-10-13 18:46     ` Eric Sandeen
2025-10-13 19:04       ` Dominique Martinet [this message]
2025-11-26 20:16     ` Remi Pommarel
2025-11-26 22:43       ` Dominique Martinet
2025-12-01 22:36         ` Eric Sandeen
2025-12-02  1:04           ` Dominique Martinet
2025-12-02 22:12             ` Eric Sandeen
2025-12-03 15:13               ` Dominique Martinet
2025-12-03 16:23                 ` Eric Sandeen
2025-12-05 11:53                 ` Remi Pommarel
2025-12-05 12:56                   ` Dominique Martinet
2025-12-02 22:30   ` [PATCH V3 5/4] 9p: fix cache option printing in v9fs_show_options Eric Sandeen
2025-12-02 23:13     ` Al Viro
2025-12-03  1:09       ` Eric Sandeen
2025-12-03 15:04         ` Dominique Martinet
2025-12-03 18:04           ` Al Viro
2025-12-02 22:34   ` [PATCH V3 6/4] 9p: fix new mount API cache option handling Eric Sandeen

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=aO1NLCI3kIdgWcvh@codewreck.org \
    --to=asmadeus@codewreck.org \
    --cc=eadavis@qq.com \
    --cc=ericvh@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --cc=sandeen@redhat.com \
    --cc=sandeen@sandeen.net \
    --cc=v9fs@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.