Re: [PATCH] erofs: support SEEK_HOLE/SEEK_DATA in inode_share mode

Jingbo Xu <[email protected]>
Newsgroups org.ozlabs.lists.linux-erofs,org.kernel.vger.linux-kernel
Message-ID <[email protected]>

On 8/20/26 11:10 AM, Zhan Xusheng wrote:
> 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.

Right.  I think that would be another patch to fix that.

-- 
Thanks,
Jingbo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.