mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus@codewreck.org>
To: Michael Mulqueen <mike@method-b.uk>
Cc: David Howells <dhowells@redhat.com>,
	Pierre Barre <pierre@barre.sh>,
	ericvh@kernel.org, lucho@ionkov.net, linux_oss@crudebyte.com,
	v9fs@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 9p: fix data corruption with writeback caching during concurrent stat
Date: Wed, 18 Nov 2026 22:45:21 +0900	[thread overview]
Message-ID: <av2r8RSBGsPlDPPG@codewreck.org> (raw)
In-Reply-To: <e2c960ca-7b29-45e1-b650-849fc357f8b0@method-b.uk>

Michael Mulqueen wrote on Wed, Nov 18, 2026 at 12:22:00PM +0000:
> I've bisected it with my reproducer script and found it was introduced
> in v6.4, specifically commit d9bc0d11e33b. I wasn't sure about the
> etiquette of jumping straight into a discussion and tagging regzbot, so
> I haven't, but I'm pretty confident that this is where the regression
> was introduced.

Bleh... Given how old it is I'm not sure regzbot is appropriate (as
Thorsten pointed out), but it is a bad bug and the lack of follow-up /
time on my part hasn't helped, having reminders would have helped and
can still help if nobody feeds the machine so on my side tagging regzbot
even now is welcome, even if I'd like to hope we can finally get this
fixed in a timely manner - the third time's the charm?


> That is the commit that adds the writeback path -
> before it, cache=mmap did not buffer writes through the page cache, so
> a stale getattr had no unsent data to zero.

Right, I wasn't much part of the cache rewrite, but cache=mmap not going
through the page cache meant that concurrent writes + modifying mmap
would corrupt the file, so I think enabling write cache makes sense --
even if it's a side effect that probably ought to have been commented
better.

The problem is that this bug happens with cache=writeback in the first
place; I expect this isn't making more noise because applications
generally don't stat what they're doing but also that cache modes aren't
default so probably aren't used all that much...

> I have tried the fixes (Pierre Barre's v1 and v2, 27 December 2025, and
> David Howells' sketch, 18 February 2026) discussed in this thread

For reference:
Pierre's v1 https://lore.kernel.org/v9fs/20251227083751.715152-1-pierre@barre.sh/
Pierre's v2 https://lore.kernel.org/v9fs/20251227180137.730385-1-pierre@barre.sh/
David's sketch https://lore.kernel.org/v9fs/1667424.1771432276@warthog.procyon.org.uk/

There also was another simple shell repro here:
https://lore.kernel.org/v9fs/2025543.PYKUYFuaPT@weasel/


As for the way forward, I'm a bit stuck: David pretty much NACK'd
Pierre's patch and sent only a draft that I wasn't able to process
(given my chronic lack of time for 9p)...

For starters since you've already rebased the patch, could you resend it
as a v2 as a proper patch? just looking at the diff I expect the
conflict to be around the size update in v9fs_issue_write() and easy to
fix but I'd like to at least get the patch sent properly so sashiko has
a look.

Given the commit message I also wanted David to split the patch at the
time, but now I've actually read the diff it's all intertangled and I
don't really care anymore so let's go on with it.

Thanks again,
-- 
Dominique Martinet | Asmadeus

      parent reply	other threads:[~2026-11-19  2:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-27  8:37 Pierre Barre
2025-12-27 11:30 ` Christian Schoenebeck
2025-12-27 17:58   ` Pierre Barre
2026-02-18 14:04 ` David Howells
2026-02-18 16:31 ` David Howells
2026-11-18 12:22   ` Michael Mulqueen
2026-11-18 13:11     ` Thorsten Leemhuis
2026-11-18 13:45     ` Dominique Martinet [this message]

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=av2r8RSBGsPlDPPG@codewreck.org \
    --to=asmadeus@codewreck.org \
    --cc=dhowells@redhat.com \
    --cc=ericvh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --cc=mike@method-b.uk \
    --cc=pierre@barre.sh \
    --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

all inboxes | Powered by JetHome®