From: Hugh Dickins <hughd@google.com>
To: Matthew Wilcox <willy@infradead.org>, Brian Foster <bfoster@redhat.com>
Cc: linux-mm@kvack.org, Hugh Dickins <hughd@google.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>
Subject: Re: [PATCH] tmpfs: zero post-eof folio range on file extension
Date: Wed, 25 Jun 2025 22:35:44 -0700 (PDT) [thread overview]
Message-ID: <ced3a3b7-fc60-db07-0a59-763549027dfb@google.com> (raw)
In-Reply-To: <aFxMHzBabpMt0Bno@casper.infradead.org>
On Wed, 25 Jun 2025, Matthew Wilcox wrote:
> On Wed, Jun 25, 2025 at 02:49:30PM -0400, Brian Foster wrote:
> > Most traditional filesystems zero the post-eof portion of the eof
> > folio at writeback time, or when the file size is extended by
> > truncate or extending writes. This ensures that the previously
> > post-eof range of the folio is zeroed before it is exposed to the
> > file.
> >
> > tmpfs doesn't implement the writeback path the way a traditional
> > filesystem does, so zeroing behavior won't be exactly the same.
> > However, it can still perform explicit zeroing from the various
> > operations that extend a file and expose a post-eof portion of the
> > eof folio. The current lack of zeroing is observed via failure of
> > fstests test generic/363 on tmpfs. This test injects post-eof mapped
> > writes in certain situations to detect gaps in zeroing behavior.
> >
> > Add a new eof zeroing helper for file extending operations. Look up
> > the current eof folio, and if one exists, zero the range about to be
> > exposed. This allows generic/363 to pass on tmpfs.
>
> This seems like what I did here?
>
> https://lore.kernel.org/linux-fsdevel/20230202204428.3267832-4-willy@infradead.org/
>
> Which fix should we prefer?
Thank you Brian, thank you Matthew.
Of course my immediate reaction is to prefer the smaller patch,
Matthew's, but generic/363 still fails with that one: I need to look
into what each of you is doing (and that mail thread from 2023) and
make up my own mind.
(I'm worried why I had no copy of Matthew's 2023 patch: it's sadly
common for me to bury patches for long periods of time, but not
usually to lose them completely. But that is my worry, not yours.)
I haven't been much concerned by generic/383 failing on tmpfs:
but promise to respect your efforts in due course.
I procrastinate "in due course" because (a) the full correct answwer
will depend on what happens with large folios, and (b) large folio
work in 6.14 changed (I'll say broke) the behaviour of huge=always
at eof (I expected a danger of that, and thought I checked before
6.14-rc settled, but must have messed up my checking somehow).
So there's more (and more urgent) to sort out before settling on
the right generic/383 fix.
Thanks,
Hugh
next prev parent reply other threads:[~2025-06-26 5:35 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-25 18:49 [PATCH] tmpfs: zero post-eof folio range on file extension Brian Foster
2025-06-25 19:21 ` Matthew Wilcox
2025-06-26 5:35 ` Hugh Dickins [this message]
2025-06-26 12:55 ` Brian Foster
2025-06-27 3:21 ` Baolin Wang
2025-06-27 11:54 ` Brian Foster
2025-07-09 7:57 ` Hugh Dickins
2025-07-10 6:47 ` Baolin Wang
2025-07-10 22:20 ` Hugh Dickins
2025-07-11 3:50 ` Baolin Wang
2025-07-11 7:50 ` Hugh Dickins
2025-07-11 8:42 ` Baolin Wang
2025-07-11 16:08 ` Brian Foster
2025-07-11 20:15 ` Brian Foster
2025-07-14 3:05 ` Baolin Wang
2025-07-14 14:38 ` Brian Foster
2025-07-10 12:36 ` Brian Foster
2025-07-10 23:02 ` Hugh Dickins
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=ced3a3b7-fc60-db07-0a59-763549027dfb@google.com \
--to=hughd@google.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=bfoster@redhat.com \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.org \
/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).