All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Schoenebeck <linux_oss@crudebyte.com>
To: Tingmao Wang <m@maowtm.org>, Dominique Martinet <asmadeus@codewreck.org>
Cc: Eric Van Hensbergen <ericvh@kernel.org>,
	Latchesar Ionkov <lucho@ionkov.net>,
	v9fs@lists.linux.dev
Subject: Re: [PATCH v2] fs/9p: Don't open remote file with APPEND mode when writeback cache is used
Date: Mon, 10 Nov 2025 14:25:20 +0100	[thread overview]
Message-ID: <3315313.d5zAtLYnLX@silver> (raw)
In-Reply-To: <aQha--QBgwu8DoDE@codewreck.org>

On Monday, November 3, 2025 8:34:19 AM CET Dominique Martinet wrote:
> Thanks for the v2
> 
> Tingmao Wang wrote on Sun, Nov 02, 2025 at 11:56:30PM +0000:
> > I haven't done a bisect to figure out if this regression was introduced by
> > a change or was this behaviour always present - 6.14 has the same problem
> > and 6.13 did not compile for me due to some problem with bool / true /
> > false being a keyword in c23, and it could not compile with c17 either.
> 
> Ok so you got me at the "it happens in cache=loose too", so I went ahead
> with bisect... I had the same problem with newer gcc being c23 and older
> kernels being silly, you'd think `KCFLAGS=-std=gnu11` is enough but some
> arch makefiles ignore that so I went in heavy patching
> arch/x86/boot/Makefile and arch/x86/boot/compressed/Makefile . . .
> ... Anyway, it certainly didn't break recently, but it's not ages ago
> either: the repro you made (thank you!!) starts failing in 6.4 cache
> rework: the first bad commit is actually 21e26d5e54ab ("fs/9p: Fix bit
> operation logic error"), but that's just a fixup of the previous commit
> so 4eb3117888a9 ("fs/9p: Rework cache modes and add new options to
> Documentation") is the cluprit... and... I'm not quite sure I get why
> without digging deeper...
> (But at least that made me realize the commit just before, 1543b4c5071c
> ("fs/9p: remove writeback fid and fix per-file modes"), removed the
> writeback fid I was talking about... But that commit was working (with a
> sane ~P9_OWRITE mask), so it's not directly that removal that broke
> things, but something else in the rework)

Haven't tested, but to me it looks like 1543b4c5071c ("fs/9p: remove writeback 
fid and fix per-file modes") was the causing change. Up to that commit the 
open flags were hard coded to exactly O_RDWR for all writeback fids:

struct p9_fid *v9fs_writeback_fid(struct dentry *dentry)
{
    ...
    /*
     * writeback fid will only be used to write back the
     * dirty pages. We always request for the open fid in read-write
     * mode so that a partial page write which result in page
     * read can work.
     */
    err = p9_client_open(fid, O_RDWR);
    ...
}

/Christian

> Anyway, I think this commit is a strict improvement over the current
> situation, I'll just slap a Fixes tag and push to -next for now, and if
> time allows I'll try to have a closer look...
> 
> Thanks,



  reply	other threads:[~2025-11-10 13:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-02 20:24 [PATCH 0/1] fs/9p: Do not open remote file with APPEND mode when writeback cache is used Tingmao Wang
2025-11-02 20:24 ` [PATCH 1/1] " Tingmao Wang
2025-11-02 23:07   ` Dominique Martinet
2025-11-02 23:56     ` [PATCH v2] fs/9p: Don't " Tingmao Wang
2025-11-03  7:34       ` Dominique Martinet
2025-11-10 13:25         ` Christian Schoenebeck [this message]
2025-11-10 14:22       ` Christian Schoenebeck
2025-11-02 23:58     ` [PATCH 1/1] fs/9p: Do not " Tingmao Wang

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=3315313.d5zAtLYnLX@silver \
    --to=linux_oss@crudebyte.com \
    --cc=asmadeus@codewreck.org \
    --cc=ericvh@kernel.org \
    --cc=lucho@ionkov.net \
    --cc=m@maowtm.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 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.