Commit 4d0200d0 authored by Sheng Yong's avatar Sheng Yong Committed by Sandeep Dhavale
Browse files

BACKPORT: erofs: add 'fsoffset' mount option to specify filesystem offset



When attempting to use an archive file, such as APEX on android,
as a file-backed mount source, it fails because EROFS image within
the archive file does not start at offset 0. As a result, a loop
or a dm device is still needed to attach the image file at an
appropriate offset first. Similarly, if an EROFS image within a
block device does not start at offset 0, it cannot be mounted
directly either.

To address this issue, this patch adds a new mount option `fsoffset=x'
to accept a start offset for the primary device. The offset should be
aligned to the block size. EROFS will add this offset before performing
read requests.

Signed-off-by: default avatarSheng Yong <shengyong1@xiaomi.com>
Signed-off-by: default avatarWang Shuai <wangshuai12@xiaomi.com>
Reviewed-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20250517090544.2687651-1-shengyong1@xiaomi.com


[ Gao Xiang: minor update on documentation and the error message. ]
Reviewed-by: default avatarHongbo Li <lihongbo22@huawei.com>
Signed-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>

Bug: 428292438
Change-Id: Iae548d62c473aa380f394ecca1422588c25ef418
(cherry picked from commit c36ec00d)
[Wang Shuai: Resolved minor conflict in fs/erofs/super.c ]
Signed-off-by: default avatarWang Shuai <wangshuai12@xiaomi.corp-partner.google.com>
parent 399deda7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment