]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
erofs: allow sharing page cache with the same aops only
authorHongbo Li <lihongbo22@huawei.com>
Sat, 14 Feb 2026 03:02:48 +0000 (03:02 +0000)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Mon, 23 Feb 2026 10:04:18 +0000 (18:04 +0800)
commit03c0d030f5874eec6ce22750b2b8751d6d4303b5
tree31e5bbdf214ab41d5c1c0775c4ecc200845c7340
parent6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
erofs: allow sharing page cache with the same aops only

Inode with identical data but different @aops cannot be mixed
because the page cache is managed by different subsystems (e.g.,
@aops for compressed on-disk inodes cannot handle plain on-disk
inodes).

In this patch, we never allow inodes to share the page cache
among plain, compressed, and fileio cases. When a shared inode
is created, we initialize @aops that is the same as the initial
real inode, and subsequent inodes cannot share the page cache
if the inferred @aops differ from the corresponding shared inode.

This is reasonable as a first step because, in typical use cases,
if an inode is compressible, it will fall into compressed
inodes across different filesystem images unless users use plain
filesystems. However, in that cases, users will use plain
filesystems all the time.

Fixes: 5ef3208e3be5 ("erofs: introduce the page cache share feature")
Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
fs/erofs/inode.c
fs/erofs/internal.h
fs/erofs/ishare.c