From: Petr Chmelar <petr.chmelar@innovatrics.com>
To: David Howells <dhowells@redhat.com>
Cc: Christian Brauner <christian@brauner.io>,
Paulo Alcantara <pc@manguebit.org>,
Matthew Wilcox <willy@infradead.org>,
Namjae Jeon <linkinjeon@kernel.org>,
Marc Dionne <marc.dionne@auristor.com>,
Stefan Metzmacher <metze@samba.org>,
Eric Van Hensbergen <ericvh@kernel.org>,
Dominique Martinet <asmadeus@codewreck.org>,
Ilya Dryomov <idryomov@gmail.com>,
netfs@lists.linux.dev, linux-afs@lists.infradead.org,
linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org,
ceph-devel@vger.kernel.org, v9fs@lists.linux.dev,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v12 4/5] cachefiles: Don't rely on backing fs storage map for most use cases
Date: Sun, 11 Oct 2026 05:29:43 +0000 [thread overview]
Message-ID: <20261011.cachefiles-partial-zeros.pchmelar@innovatrics.com> (raw)
In-Reply-To: <20260910220242.2165023-5-dhowells@redhat.com>
Hi David,
With this patch, reading a file whose cache object is only partly
filled returns wrong data, mostly whole 64 KiB blocks of zeros. A
second full read returns the same wrong blocks. It reproduces over
NFS and 9p on vfs-7.4.netfs (9f8b64f66). Over 9p it bisects to this
patch, 13e340e397 in that branch; over NFS its parent is clean and the
branch tip is not.
#regzbot introduced: 13e340e397
Reproducer: random 64 KiB reads covering half of a 256 MiB file of
random data, then a full read after dropping the page cache, compared
with the original per 64 KiB block:
fio --name=half --filename=/mnt/part.bin --rw=randread --bs=64k \
--ioengine=psync --fadvise_hint=random --size=256m --io_size=128m \
--randrepeat=1
sync; echo 3 > /proc/sys/vm/drop_caches
cmp /mnt/part.bin /path/to/original
Setup: QEMU 8.2.2 (TCG, 4 vCPUs), cache on a fresh XFS on a loop device
(2 GiB for 9p, 4 GiB for NFS), cachefilesd 0.10.10 with brun 10%, bcull
7%, bstop 3%, fio 3.36. Mounts:
NFS: NFSv4.2 loopback export of a tmpfs, vers=4.2,fsc,actimeo=1
9p: trans=virtio,version=9p2000.L,cache=fscache,msize=1048576
Wrong 64 KiB blocks out of 4096, first full read / second full read:
kernel mount wrong all zeros
v7.3-rc6 9p 0 / 0 0
e0aa90eb8c 9p 0 / 0 0
98e0cd700d (parent) 9p 0 / 0 0
98e0cd700d (parent) NFS 0 / 0 0
13e340e397 (this) 9p 936 / 936 825
8097a263bd (merge) 9p 936 / 936 825
9f8b64f66 9p 936 / 936 825
9f8b64f66 NFS 817 / 817 817
9f8b64f66 9p loose 0 / 0 0
"9p loose" is the 9p mount with cache=loose, without fscache.
On 9f8b64f66 over 9p, three runs gave the same counts and the same
first wrong blocks. The first wrong blocks are 10, 13, 15, 24, 26 and
27 over 9p, and 50, 51, 53, 54, 55 and 56 over NFS.
Two more observations, in case they help:
- Over 9p, after the random fill and both full reads, the backing
object has 451 extents with this patch and 28 on v7.3-rc6 (37 on
98e0cd700d).
- Over NFS on 9f8b64f66, the fscache counters after the fill and both
full reads are IO rd=371 wr=2189. I haven't traced whether the
zeros come from reads over holes in the backing file or from what
was written to it.
Over NFS, a server-side rewrite of the file (invalidation) and a shrink
and regrow through the mount both read back correctly on 9f8b64f66 and
98e0cd700d.
I found this while testing a workaround for slow reads from fragmented
cache objects, which I describe in a reply to the cover letter:
https://lore.kernel.org/r/20261011.cachefiles-seek-hole-walk.pchmelar@innovatrics.com
It reproduces without that workaround. The reproducer and the
bisection were done with LLM assistance.
Thanks,
Petr
next prev parent reply other threads:[~2026-10-11 5:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 22:02 [PATCH v12 0/5] netfs, cachefiles: Changes for next, primarily occupancy tracking-related David Howells
2026-09-10 22:02 ` [PATCH v12 1/5] cachefiles: Clean up cachefiles_do_prepare_read() David Howells
2026-09-11 20:19 ` Paulo Alcantara
2026-09-10 22:02 ` [PATCH v12 2/5] netfs, cachefiles: Add a couple of traces for write failure David Howells
2026-09-11 20:19 ` Paulo Alcantara
2026-09-10 22:02 ` [PATCH v12 3/5] cachefiles: Add a tracepoint to log insufficient space errors David Howells
2026-09-11 20:19 ` Paulo Alcantara
2026-09-10 22:02 ` [PATCH v12 4/5] cachefiles: Don't rely on backing fs storage map for most use cases David Howells
2026-10-11 5:29 ` Petr Chmelar [this message]
2026-09-10 22:02 ` [PATCH v12 5/5] cachefiles: Preset the state xattr when creating a new file David Howells
2026-09-11 20:21 ` Paulo Alcantara
2026-09-25 14:15 ` [PATCH v12 0/5] netfs, cachefiles: Changes for next, primarily occupancy tracking-related Christian Brauner
2026-10-11 5:29 ` Petr Chmelar
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=20261011.cachefiles-partial-zeros.pchmelar@innovatrics.com \
--to=petr.chmelar@innovatrics.com \
--cc=asmadeus@codewreck.org \
--cc=ceph-devel@vger.kernel.org \
--cc=christian@brauner.io \
--cc=dhowells@redhat.com \
--cc=ericvh@kernel.org \
--cc=idryomov@gmail.com \
--cc=linkinjeon@kernel.org \
--cc=linux-afs@lists.infradead.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=marc.dionne@auristor.com \
--cc=metze@samba.org \
--cc=netfs@lists.linux.dev \
--cc=pc@manguebit.org \
--cc=v9fs@lists.linux.dev \
--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
all inboxes | Powered by JetHome®