public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus@codewreck.org>
To: Christian Schoenebeck <linux_oss@crudebyte.com>
Cc: ericvh@kernel.org, lucho@ionkov.net,
	Pierre Barre <pierre@barre.sh>,
	v9fs@lists.linux.dev, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, sandeen@redhat.com
Subject: Re: [PATCH] 9p: fix access mode flags being ORed instead of replaced
Date: Thu, 16 Apr 2026 11:53:05 +0900	[thread overview]
Message-ID: <aeBPEcmAaVv5Vt5d@codewreck.org> (raw)
In-Reply-To: <2406037.ElGaqSPkdT@weasel>

Christian Schoenebeck wrote on Thu, Apr 09, 2026 at 04:51:07PM +0200:
> > diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
> > index 057487efaaeb..05a5e1c4df35 100644
> > --- a/fs/9p/v9fs.c
> > +++ b/fs/9p/v9fs.c
> > @@ -413,7 +413,11 @@ static void v9fs_apply_options(struct v9fs_session_info
> > *v9ses, /*
> >          * Note that we must |= flags here as session_init already
> >          * set basic flags. This adds in flags from parsed options.
> > +        * Access flags are mutually exclusive, so clear any access
> > +        * bits set by session_init before applying the user's choice.
> 
> That phrase is a bit suboptimal, because V9FS_ACCESS_ANY is actually a bit
> combination of single, user and client. But OK, I currently don't have a
> better phrase for it since the access fields have to be replaced altogether.

Yeah, it's not so much that they're mutually exclusive that we need to
clear the default value before applying the settings.
The key distinction here is that it's not "any access bits set" -- if it
were arbitrary values then it wouldn't be acceptable to just or the
flags out, you could risk e.g. creating a client with 2000L but setting
another protocol in the flags and there'd be no end of things to check.

Something like this?
           * Default access flags must be cleared if session options
	   * change them to avoid mangling the setting.

> As for the actual behaviour change; makes sense to me:

Yes, that works for me.

Note your patch converted tabs to space and couldn't be applied -- if
you have to send patches by web mail please attach them instead, that'll
be easier to apply than a corrupted patch, even if some tooling like
sashiko won't run (it doesn't run on corrupted patches anyway..)


If you're fine with my wording for the comment I'll modify it in place,
otherwise we have a few more days to discuss this before I sent to Linus
for 7.1-rc1
(and I'm really sorry for my lack of reactivity, I'm sure I'll miss some
patches anyway...)

-- 
Dominique Martinet | Asmadeus

  reply	other threads:[~2026-04-16  2:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-02 10:03 [PATCH] 9p: fix access mode flags being ORed instead of replaced Pierre Barre
2026-04-02 10:10 ` Pierre Barre
2026-04-09  8:12 ` Pierre Barre
2026-04-09 14:51 ` Christian Schoenebeck
2026-04-16  2:53   ` Dominique Martinet [this message]
2026-04-16  6:42     ` Pierre Barre

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=aeBPEcmAaVv5Vt5d@codewreck.org \
    --to=asmadeus@codewreck.org \
    --cc=ericvh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --cc=pierre@barre.sh \
    --cc=sandeen@redhat.com \
    --cc=stable@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox