All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Jingbo Xu <jefflexu@linux.alibaba.com>, linux-erofs@lists.ozlabs.org
Subject: Re: [PATCH v8 7/8] erofs-utils: mkfs: introduce rebuild mode
Date: Thu, 14 Sep 2023 15:49:38 +0800	[thread overview]
Message-ID: <ec2ebae2-200d-6f9c-6989-4c889beb5cbd@linux.alibaba.com> (raw)
In-Reply-To: <20230913120304.15741-8-jefflexu@linux.alibaba.com>



On 2023/9/13 20:03, Jingbo Xu wrote:
> Introduce a new EXPERIMENTAL rebuild mode, which can be used to
> generate a meta-only multidev manifest image with an overlayfs-like
> merged tree from multiple specific EROFS images either of
> 
> tarerofs index mode (--tar=i):
> 
>    mkfs.erofs --tar=i --aufs layer0.erofs layer0.tar
>    ...
>    mkfs.erofs --tar=i --aufs layerN.erofs layerN-1.tar
> 
> or mkfs.erofs uncompressed mode without inline data:
> 
>    mkfs.erofs --tar=f -Enoinline_data --aufs layer0.erofs layer0.tar
>    ...
>    mkfs.erofs --tar=f -Enoinline_data --aufs layerN-1.erofs layerN-1.tar
> 
> To merge these layers, just type:
>    mkfs.erofs merged.erofs layer0.erofs ... layerN-1.erofs
> 
> It doesn't support compression and/or flat inline datalayout yet.
> 
> Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

As Jingbo reported, applying the following diff to fix the device table:

diff --git a/mkfs/main.c b/mkfs/main.c
index 389bb1b..c5dda66 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -590,10 +590,9 @@ static int mkfs_parse_options_cfg(int argc, char *argv[])
  
  		if (rebuild_mode) {
  			char *srcpath = cfg.c_src_path;
+			struct erofs_sb_info *src;
  
  			do {
-				struct erofs_sb_info *src;
-
  				src = calloc(1, sizeof(struct erofs_sb_info));
  				if (!src) {
  					erofs_rebuild_cleanup();
@@ -823,7 +822,7 @@ static int erofs_rebuild_load_trees(struct erofs_inode *root)
  	struct erofs_sb_info *src;
  	unsigned int extra_devices = 0;
  	erofs_blk_t nblocks;
-	int ret, i = 0;
+	int ret;
  
  	list_for_each_entry(src, &rebuild_src_list, list) {
  		ret = erofs_rebuild_load_tree(root, src);
@@ -853,7 +852,7 @@ static int erofs_rebuild_load_trees(struct erofs_inode *root)
  			nblocks = src->devs[0].blocks;
  		else
  			nblocks = src->primarydevice_blocks;
-		sbi.devs[i++].blocks = nblocks;
+		sbi.devs[src->dev - 1].blocks = nblocks;
  	}
  	return 0;
  }
-- 
2.19.1.6.gb485710b

  reply	other threads:[~2023-09-14  7:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13 12:02 [PATCH v8 0/8] erofs-utils: mkfs: introduce rebuild mode Jingbo Xu
2023-09-13 12:02 ` [PATCH v8 1/8] erofs-utils: lib: add list_splice_tail() helper Jingbo Xu
2023-09-13 12:02 ` [PATCH v8 2/8] erofs-utils: lib: make erofs_get_unhashed_chunk() global Jingbo Xu
2023-09-13 12:02 ` [PATCH v8 3/8] erofs-utils: lib: add erofs_read_xattrs_from_disk() helper Jingbo Xu
2023-09-13 12:02 ` [PATCH v8 4/8] erofs-utils: lib: add erofs_insert_ihash() helper Jingbo Xu
2023-09-13 12:03 ` [PATCH v8 5/8] erofs-utils: lib: add erofs_rebuild_get_dentry() helper Jingbo Xu
2023-09-13 12:03 ` [PATCH v8 6/8] erofs-utils: lib: add erofs_rebuild_load_tree() helper Jingbo Xu
2023-09-13 12:03 ` [PATCH v8 7/8] erofs-utils: mkfs: introduce rebuild mode Jingbo Xu
2023-09-14  7:49   ` Gao Xiang [this message]
2023-09-13 12:03 ` [PATCH v8 8/8] erofs-utils: mkfs: add `--ovlfs-strip` option Jingbo Xu
2023-09-13 13:47   ` Gao Xiang
2023-09-13 12:03 ` [PATCH v3] erofs-utils: lib: refactor extended attribute name prefixes Jingbo Xu
2023-09-13 12:13   ` Jingbo Xu

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=ec2ebae2-200d-6f9c-6989-4c889beb5cbd@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=jefflexu@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 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.