All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <xiang@kernel.org>
To: Yifan Zhao <zhaoyifan28@huawei.com>
Cc: linux-erofs@lists.ozlabs.org, hsiangkao@linux.alibaba.com,
	jingrui@huawei.com, wayne.ma@huawei.com, zhukeqian1@huawei.com
Subject: Re: [PATCH 2/2] erofs-utils: mkfs: validate source and dataimport mode combinations
Date: Sat, 14 Feb 2026 10:47:23 +0800	[thread overview]
Message-ID: <aY_iO5zcsITyYrhI@debian> (raw)
In-Reply-To: <20260213073241.525158-2-zhaoyifan28@huawei.com>

Hi Yifan,

On Fri, Feb 13, 2026 at 03:32:41PM +0800, Yifan Zhao wrote:
> This patch adds validation for all combinations of source mode and
> dataimport mode, and prints corresponding error/warning messages.
> It should have no impact on external behavior.
> 
> Signed-off-by: Yifan Zhao <zhaoyifan28@huawei.com>
> ---
>  mkfs/main.c | 144 +++++++++++++++++++++++++++++++++++++++++++++++-----
>  1 file changed, 131 insertions(+), 13 deletions(-)
> 
> diff --git a/mkfs/main.c b/mkfs/main.c
> index a948b2e..e369347 100644
> --- a/mkfs/main.c
> +++ b/mkfs/main.c
> @@ -169,7 +169,7 @@ static void usage(int argc, char **argv)
>  	}
>  	printf(
>  		" -C#                    specify the size of compress physical cluster in bytes\n"
> -		" -EX[,...]              X=extended options\n"
> +		" -EX[,...]              X=extended options, see mkfs.erofs(1) manual for details\n"
>  		" -L volume-label        set the volume label (maximum 15 bytes)\n"
>  		" -m#[:X]                enable metadata compression (# = physical cluster size in bytes;\n"
>  		"                                                     X = another compression algorithm for metadata)\n"
> @@ -300,6 +300,10 @@ static struct ocierofs_config ocicfg;
>  static bool mkfs_oci_tarindex_mode;
>  
>  enum {
> +	/* XXX: the "DEFAULT" mode is actually source-dependent,
> +	 * meaning BLOB_INDEX for rebuild mode and FULLDATA for others.
> +	 * Consider refactoring this...
> +	 */
>  	EROFS_MKFS_DATA_IMPORT_DEFAULT,
>  	EROFS_MKFS_DATA_IMPORT_FULLDATA,
>  	EROFS_MKFS_DATA_IMPORT_RVSP,
> @@ -314,6 +318,118 @@ static enum {
>  	EROFS_MKFS_SOURCE_REBUILD,
>  } source_mode;
>  
> +static int erofs_mkfs_validate_source_datamode(void)
> +{

Honestly, I don't like a unique place to deal with all arbitrary
combinations, but we could add test cases to test all valid
combinations.

Also I don't think I will treat this for the upcoming
erofs-utils since it may cause potential regression, let's address
this after erofs-utils 1.9 is out.

Thanks,
Gao Xiang


  reply	other threads:[~2026-02-14  2:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-13  7:32 [PATCH 1/2] erofs-utils: manpage: document missing options for mkfs.erofs Yifan Zhao
2026-02-13  7:32 ` [PATCH 2/2] erofs-utils: mkfs: validate source and dataimport mode combinations Yifan Zhao
2026-02-14  2:47   ` Gao Xiang [this message]
2026-02-14  2:44 ` [PATCH 1/2] erofs-utils: manpage: document missing options for mkfs.erofs 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=aY_iO5zcsITyYrhI@debian \
    --to=xiang@kernel.org \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=jingrui@huawei.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=wayne.ma@huawei.com \
    --cc=zhaoyifan28@huawei.com \
    --cc=zhukeqian1@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.