[PATCH] lib/metabox: fix 48-bit layout metablock addressing
Gao Xiang
hsiangkao at linux.alibaba.com
Sat Mar 21 01:04:32 AEDT 2026
On 2026/3/20 21:59, oz456 wrote:
> Set meta_blkaddr to 0 for 48-bit layouts instead of EROFS_META_NEW_ADDR to properly support large filesystems.
> Tested on normal and 48-bit layouts; meta_blkaddr is correct.
>
> Signed-off-by: oz456 <reach.netway at gmail.com>
why all you guys change this line?
If you don't run into anything, could you please
not touch this if you don't know enough about the codebase?
> ---
> lib/metabox.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lib/metabox.c b/lib/metabox.c
> index 12706aa..5e55cae 100644
> --- a/lib/metabox.c
> +++ b/lib/metabox.c
> @@ -62,8 +62,10 @@ int erofs_metadata_init(struct erofs_sb_info *sbi)
> if (ret)
> goto err_free;
> sbi->m2gr = m2gr;
> - /* FIXME: sbi->meta_blkaddr should be 0 for 48-bit layouts */
> - sbi->meta_blkaddr = EROFS_META_NEW_ADDR;
> + if (erofs_sb_has_48bit(sbi))
> + sbi->meta_blkaddr = 0;
> + else
> + sbi->meta_blkaddr = EROFS_META_NEW_ADDR;
> }
>
> if (!sbi->mxgr && erofs_sb_has_metabox(sbi)) {
More information about the Linux-erofs
mailing list