public inbox for linux-erofs@ozlabs.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: puneeth_aditya_5656 <myakampuneeth@gmail.com>,
	linux-erofs@lists.ozlabs.org
Subject: Re: [PATCH] blobchunk: fix 48-bit format detection to use final remapped block addresses
Date: Tue, 24 Feb 2026 14:44:41 +0800	[thread overview]
Message-ID: <8a1690fb-4074-4eec-88df-ef7290e75529@linux.alibaba.com> (raw)
In-Reply-To: <20260224055712.14110-1-myakampuneeth@gmail.com>

Hi puneeth_aditya_5656,

Could you format the commit message instead of leaving
the commit message empty (maximum 72 chars per line).

The subject needs to be fixed as:

erofs-utils: lib: fix 48bit addressing detection for chunk-based format

On 2026/2/24 13:57, puneeth_aditya_5656 wrote:
> ---
>   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 *);


I think it's too late to adjust inode->u.chunkformat,
see erofs_iflush():

I think you currently just add a new function like:

erofs_inode_fixup_chunkformat() {

	u64 extent_count = inode->extent_isize / unit;

	_48bit = inode->u.chunkformat & EROFS_CHUNK_FORMAT_48BIT;
	if (_48bit)
		return;

	for (src = 0; src < extent_count; ++src) {
		if (chunk->blkaddr == EROFS_NULL_ADDR)
			continue;
		if (chunk->device_id) {
			if (chunk->blkaddr > UINT32_MAX) {
				_48bit = true;
				break;
			}
		} else if (remapped_base + chunk->blkaddr > UINT32_MAX) {
			_48bit = true;
			break;
		}
	}
	if (_48bit)
		inode->u.chunkformat |= EROFS_CHUNK_FORMAT_48BIT;
}

Also if we really would like to fix this, we need considering add
a testcase for this, possibly use `--offset` to make the image
exceeds 32-bit, see experimental-tests.

Thanks,
Gao Xiang


  reply	other threads:[~2026-02-24  6:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24  5:57 [PATCH] blobchunk: fix 48-bit format detection to use final remapped block addresses puneeth_aditya_5656
2026-02-24  6:44 ` Gao Xiang [this message]
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=8a1690fb-4074-4eec-88df-ef7290e75529@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=myakampuneeth@gmail.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