RE: [PATCH] erofs: allocate file-backed mount requests from a bio_set
From: Daejun Park
Date: Fri Oct 30 2026 - 05:46:56 EST
> - Mount already rejects backing files on stacked fses and on
> file-backed EROFS. A backing read cannot reach this pool again in
> the same task.
This relies on the stacked fs check, and Sashiko pointed out that
inode_share gets around it.
A backing file on a block-backed EROFS passes the check, since that sb
has s_bdev. If that EROFS is mounted with inode_share, reads of the
file go through erofs_ishare_file_read_iter(), and erofs_real_inode()
may pick an inode of a file-backed EROFS in the same domain. So a
backing read can start another file-backed read in the same task,
while its own request is still held. I reproduced this in a QEMU guest
with the image on such an EROFS, and also with a device= blob there.
This is from the mount:
vfs_iocb_iter_read
erofs_fileio_rq_submit
erofs_fileio_iomap_submit_read
iomap_readahead
erofs_readahead
...
filemap_read
erofs_ishare_file_read_iter
vfs_iocb_iter_read
erofs_fileio_rq_submit
erofs_read_meta_folio
...
erofs_fc_fill_super
With this patch both requests come from erofs_fileio_bioset, so under
memory pressure the inner allocation can wait on the pool while the
outer request still holds an element of it.
The nesting itself is older than this series. File-backed mounts can
stack this way since commit 34096ba919fd ("erofs: support unencoded
inodes for page cache share"). In v2 I will add a separate fix for
that, with a Fixes tag, which treats an EROFS mounted with inode_share
as a stacked fs, and update this paragraph.
Daejun