From: puneeth_aditya_5656 <myakampuneeth@gmail.com>
To: linux-erofs@lists.ozlabs.org
Cc: hsiangkao@linux.alibaba.com,
puneeth_aditya_5656 <myakampuneeth@gmail.com>
Subject: [PATCH] blobchunk: fix 48-bit format detection to use final remapped block addresses
Date: Tue, 24 Feb 2026 11:27:12 +0530 [thread overview]
Message-ID: <20260224055712.14110-1-myakampuneeth@gmail.com> (raw)
---
lib/blobchunk.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/lib/blobchunk.c b/lib/blobchunk.c
index a051904..9b8112b 100644
--- a/lib/blobchunk.c
+++ b/lib/blobchunk.c
@@ -154,6 +154,19 @@ int erofs_write_chunk_indexes(struct erofs_inode *inode, struct erofs_vfile *vf,
unit = EROFS_BLOCK_MAP_ENTRY_SIZE;
chunkblks = 1ULL << (inode->u.chunkformat & EROFS_CHUNK_FORMAT_BLKBITS_MASK);
+
+ /* check if any chunk lands above 32-bit range once remapped_base is applied */
+ for (src = 0; src < inode->extent_isize / unit * sizeof(void *);
+ src += sizeof(void *)) {
+ struct erofs_blobchunk *chunk = *(void **)(inode->chunkindexes + src);
+
+ if (chunk->blkaddr != EROFS_NULL_ADDR && !chunk->device_id &&
+ remapped_base + chunk->blkaddr > UINT32_MAX) {
+ inode->u.chunkformat |= EROFS_CHUNK_FORMAT_48BIT;
+ break;
+ }
+ }
+
_48bit = inode->u.chunkformat & EROFS_CHUNK_FORMAT_48BIT;
for (dst = src = 0; dst < inode->extent_isize;
src += sizeof(void *), dst += unit) {
@@ -380,10 +393,6 @@ int erofs_blob_write_chunked_file(struct erofs_inode *inode, int fd,
goto err;
}
- /* FIXME! `chunk->blkaddr` is not the final blkaddr here */
- if (chunk->blkaddr != EROFS_NULL_ADDR &&
- chunk->blkaddr >= UINT32_MAX)
- inode->u.chunkformat |= EROFS_CHUNK_FORMAT_48BIT;
if (!erofs_blob_can_merge(sbi, lastch, chunk)) {
erofs_update_minextblks(sbi, interval_start, pos,
&minextblks);
--
2.52.0
next reply other threads:[~2026-02-24 5:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 5:57 puneeth_aditya_5656 [this message]
2026-02-24 6:44 ` [PATCH] blobchunk: fix 48-bit format detection to use final remapped block addresses Gao Xiang
2026-02-24 16:37 ` [PATCH v2] erofs-utils: lib: fix 48bit addressing detection for chunk-based format puneeth_aditya_5656
2026-02-24 17:44 ` Gao Xiang
2026-02-24 19:10 ` puneeth_aditya_5656
2026-02-24 19:13 ` [PATCH v3] " puneeth_aditya_5656
2026-02-25 3:55 ` Gao Xiang
2026-02-25 7:39 ` [PATCH v4] " puneeth_aditya_5656
2026-02-25 8:19 ` 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=20260224055712.14110-1-myakampuneeth@gmail.com \
--to=myakampuneeth@gmail.com \
--cc=hsiangkao@linux.alibaba.com \
--cc=linux-erofs@lists.ozlabs.org \
/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