On 2026/1/8 16:24, Amir Goldstein wrote:
On Thu, Jan 8, 2026 at 9:05 AM Gao Xiang <[email protected]> wrote:

Hi Amir,

On 2026/1/8 16:02, Amir Goldstein wrote:
On Thu, Jan 8, 2026 at 4:10 AM Gao Xiang <[email protected]> wrote:

...


Hi, Xiang

In Android APEX scenario, apex images formatted as EROFS are packed in
system.img which is also EROFS format. As a result, it will always fail
to do APEX-file-backed mount since `inode->i_sb->s_op == &erofs_sops'
is true.
Any thoughts to handle such scenario?

Sorry, I forgot this popular case, I think it can be simply resolved
by the following diff:

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 0cf41ed7ced8..e93264034b5d 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -655,7 +655,7 @@ static int erofs_fc_fill_super(struct super_block *sb, 
struct fs_context *fc)
                    */
                   if (erofs_is_fileio_mode(sbi)) {
                           inode = file_inode(sbi->dif0.file);
-                       if (inode->i_sb->s_op == &erofs_sops ||
+                       if ((inode->i_sb->s_op == &erofs_sops && !sb->s_bdev) ||

Sorry it should be `!inode->i_sb->s_bdev`, I've
fixed it in v3 RESEND:

A RESEND implies no changes since v3, so this is bad practice.

https://lore.kernel.org/r/[email protected]


Ouch! If the erofs maintainer got this condition wrong... twice...
Maybe better using the helper instead of open coding this non trivial check?

if ((inode->i_sb->s_op == &erofs_sops &&
        erofs_is_fileio_mode(EROFS_I_SB(inode)))

I was thought to use that, but it excludes fscache as the
backing fs.. so I suggest to use !s_bdev directly to
cover both file-backed mounts and fscache cases directly.

Your fs, your decision.

But what are you actually saying?
Are you saying that reading from file backed fscache has similar
stack usage to reading from file backed erofs?

Nope, I just don't want to be bothered with fscache in any
cases since it's already deprecated, IOWs I don't want such
setup works:
 erofs (file-backed) + erofs(fscache) + ...

I just want to allow
 erofs(APEX) + erofs(bdev) + ...

cases since Android users use it

in addition to
 ovl^2 + erofs + ext4 / xfs /... (composefs, containerd and ...)

Does that make sense?

Isn't filecache doing async file IO?

But as I said, AIO is not a must, it can still
fallback to sync I/Os.


If we regard fscache an extra unaccounted layer, because of all the
sync operations that it does, then we already allowed this setup a long
time ago, e.g. fscache+nfs+ovl^2.

This could be an argument to support the claim that stack usage of
file+erofs+ovl^2 should also be fine.

Anyway, I'm not sure how many users really use that so
I won't speak of that.

Thanks,
Gao Xiang


Thanks,
Amir.


Reply via email to