Re: [fuse-devel] Debugging a stale kernel cache during file growth

Matthew Wilcox
2026-04-16T22:54:44Z

On Thu, Apr 16, 2026 at 02:12:37PM +0200, Miklos Szeredi wrote:
> On Thu, 16 Apr 2026 at 09:24, Amir Goldstein <amir73il@gmail.com> wrote:
>
> > > I've recently encountered a weird issue with JuiceFS [1], a network FS
> > > which uses FUSE. tl;dr: when a file was being slowly appended, a reader
> > > of the same file on another host would periodically read a block of zero
> > > bytes instead of the actual data.
>
> Thanks for the report.
>
> I wonder if we could clear PG_uptodate on the page which had its zero
> bytes exposed by the i_size increase?
>
> Willy?

I think every filesystem which clear PG_uptodate is doing it wrong.
I know we have ~30 places which do it, and I haven't audited them all,
but clearing the uptodate bit can lead to the VM throwing an absolute
fit if any of the pages in that folio are mapped.

I don't think it'll make much difference whether it's cleared or
invalidated from the page cache. Either way we're re-reading all
the data in it, which would dominate the time saved by not doing a trip
through the page allocator.