public inbox for linux-erofs@ozlabs.org
 help / color / mirror / Atom feed
From: oz456 <reach.netway@gmail.com>
To: linux-erofs@lists.ozlabs.org
Cc: xiang@kernel.org, hsiangkao@linux.alibaba.com,
	zhaoyifan28@huawei.com, oz456 <reach.netway@gmail.com>
Subject: [PATCH] lib/metabox: fix 48-bit layout metablock addressing
Date: Fri, 20 Mar 2026 19:29:33 +0530	[thread overview]
Message-ID: <20260320135934.67331-1-reach.netway@gmail.com> (raw)

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@gmail.com>
---
 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)) {
-- 
2.34.1



             reply	other threads:[~2026-03-20 14:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 13:59 oz456 [this message]
2026-03-20 14:04 ` [PATCH] lib/metabox: fix 48-bit layout metablock addressing Gao Xiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260320135934.67331-1-reach.netway@gmail.com \
    --to=reach.netway@gmail.com \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=xiang@kernel.org \
    --cc=zhaoyifan28@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox