Re: [PATCH] erofs: support SEEK_HOLE/SEEK_DATA in inode_share mode
From: Zhan Xusheng
Date: Wed Aug 19 2026 - 23:11:17 EST
On Tue, 18 Aug 2026 19:37:13 +0800, Jingbo Xu wrote:
> - .llseek = generic_file_llseek,
> + .llseek = erofs_file_llseek,
No objection to the change. While in that table, .splice_read is the entry
left that touches the page cache without going through ->private_data:
.read_iter kiocb_clone() onto private_data, then filemap_read()
.mmap vma_set_file(vma, realfile)
.fadvise vfs_fadvise(file->private_data, ...)
.splice_read filemap_splice_read
filemap_splice_read() does init_sync_kiocb(&iocb, in), and
filemap_get_pages() then takes iocb->ki_filp->f_mapping (mm/filemap.c:2686),
so it works on the user file's mapping, which after your patch is confirmed
to be the real inode's. erofs_fill_inode() sets that mapping's a_ops
unconditionally, so the data splice() and sendfile() return is correct, but
they populate the per-file page cache from disk rather than the shared one
read() and mmap() use, caching the same content twice.
Thanks,
Zhan Xusheng