From: Jingbo Xu <jefflexu@linux.alibaba.com>
To: Gao Xiang <hsiangkao@linux.alibaba.com>, linux-erofs@lists.ozlabs.org
Subject: Re: [PATCH] erofs-utils: mkfs: support flatdev for multi-blob images
Date: Fri, 15 Sep 2023 14:59:36 +0800 [thread overview]
Message-ID: <089695ae-31dd-ae8b-e7ad-fa8dada28f41@linux.alibaba.com> (raw)
In-Reply-To: <b0489f60-5183-d7d4-7550-33c300c23a18@linux.alibaba.com>
On 9/15/23 2:35 PM, Gao Xiang wrote:
>
>
> On 2023/9/15 14:27, Jingbo Xu wrote:
>> Since kernel commit 8b465fecc35a ("erofs: support flattened block device
>> for multi-blob images"), flatdev feature is introduced to support for
>> mounting multi-blobs container image as a single block device.
>>
>> Introduce "-Eflatdev" option to generate images in flatdev mode.
>
> Why need introducing such an option
>
> mapped_blkaddr cannot be filled/fixed up all the time?
Okay. Will be updated in the next version.
>
>> Currently this can only work with rebuild mode, where the device tag is
>> filled with the uuid of the corresponding source image.
>
> ...
>
>
>> + if (cfg.c_flatdev && !rebuild_mode) {
>> + erofs_err("--flatdev is supported only in rebuild mode
>> currently");
>
> I don't think we need this, all multiple device mode can use this.
>
>
>> + return -EINVAL;
>> + }
>> +
>> if (cfg.c_compr_alg[0] && erofs_blksiz(&sbi) != getpagesize())
>> erofs_warn("Please note that subpage blocksize with
>> compression isn't yet supported in kernel. "
>> "This compressed image will only work with bs = ps =
>> %u bytes",
>> @@ -765,8 +774,15 @@ static void erofs_mkfs_default_options(void)
>> sbi.feature_compat = EROFS_FEATURE_COMPAT_SB_CHKSUM |
>> EROFS_FEATURE_COMPAT_MTIME;
>> - /* generate a default uuid first */
>> - erofs_uuid_generate(sbi.uuid);
>> + /*
>> + * Generate a default uuid first. In rebuild mode the uuid of the
>> + * source image is used as the device slot's tag. The kernel will
>> + * identify the tag as empty and fail the mount if its first byte is
>> + * zero. Apply this constraint to uuid to work around it.
>> + */
>> + do {
>> + erofs_uuid_generate(sbi.uuid);
>> + } while (!sbi.uuid[0]);
>
> why need a loop here?
To ensure the first byte of the device tag (i.e. the uuid of the source
image) is not zero, so that it won't block the mounting in flatdev mode.
--
Thanks,
Jingbo
prev parent reply other threads:[~2023-09-15 6:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-15 6:27 [PATCH] erofs-utils: mkfs: support flatdev for multi-blob images Jingbo Xu
2023-09-15 6:35 ` Gao Xiang
2023-09-15 6:59 ` Jingbo Xu [this message]
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=089695ae-31dd-ae8b-e7ad-fa8dada28f41@linux.alibaba.com \
--to=jefflexu@linux.alibaba.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