lib/metabox: fix 48-bit layout metablock addressing
PATCH 1/1 lib/metabox: fix 48-bit layout metablock addressing
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 <[email protected]>
--- lib/metabox.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
lib/metabox.c +4 -2
@@ -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)) {
Signature · 1 line
2.34.1
Quoted 4 lines · On 2026/3/20 21:59, oz456 wrote:
Set
meta_blkaddrto 0 for 48-bit layouts instead ofEROFS_META_NEW_ADDRto properly support large filesystems. Tested on normal and 48-bit layouts;meta_blkaddris correct.Signed-off-by oz456 <[email protected]>
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?
Quoted 21 lines
--- lib/metabox.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)lib/metabox.c +4
-2@@ -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)) {