Linux-EROFS Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yue Hu <zbestahu@gmail.com>
To: Gao Xiang <hsiangkao@linux.alibaba.com>
Cc: linux-erofs@lists.ozlabs.org, zhangwen@coolpad.com
Subject: Re: [PATCH 2/3] erofs-utils: use compressed pclusters to mark fragments
Date: Wed, 1 Mar 2023 22:00:06 +0800	[thread overview]
Message-ID: <20230301220006.00007467.zbestahu@gmail.com> (raw)
In-Reply-To: <20230228185459.117762-2-hsiangkao@linux.alibaba.com>

On Wed,  1 Mar 2023 02:54:58 +0800
Gao Xiang <hsiangkao@linux.alibaba.com> wrote:

> The decoded lengths of uncompressed pclusters should be
> strictly no more than encoded lengths.
> 
> Fixes: 9fa9b017f773 ("erofs-utils: mkfs: support fragments")
> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Reviewed-by: Yue Hu <huyue2@coolpad.com>

> ---
>  lib/compress.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/compress.c b/lib/compress.c
> index 0aaec30..8169990 100644
> --- a/lib/compress.c
> +++ b/lib/compress.c
> @@ -95,7 +95,7 @@ static void z_erofs_write_indexes(struct z_erofs_vle_compress_ctx *ctx)
>  		 * A lcluster cannot have three parts with the middle one which
>  		 * is well-compressed for !ztailpacking cases.
>  		 */
> -		DBG_BUGON(!ctx->e.raw && !cfg.c_ztailpacking);
> +		DBG_BUGON(!ctx->e.raw && !cfg.c_ztailpacking && !cfg.c_fragments);
>  		DBG_BUGON(ctx->e.partial);
>  		type = ctx->e.raw ? Z_EROFS_VLE_CLUSTER_TYPE_PLAIN :
>  			Z_EROFS_VLE_CLUSTER_TYPE_HEAD;
> @@ -457,7 +457,7 @@ frag_packing:
>  			if (ret < 0)
>  				return ret;
>  			ctx->e.compressedblks = 0; /* indicate a fragment */
> -			ctx->e.raw = true;
> +			ctx->e.raw = false;
>  			ctx->fragemitted = true;
>  			fix_dedupedfrag = false;
>  		/* tailpcluster should be less than 1 block */
> @@ -928,7 +928,7 @@ int erofs_write_compressed_file(struct erofs_inode *inode, int fd)
>  		z_erofs_write_indexes(&ctx);
>  		ctx.e.length = inode->fragment_size;
>  		ctx.e.compressedblks = 0;
> -		ctx.e.raw = true;
> +		ctx.e.raw = false;
>  		ctx.e.partial = false;
>  		ctx.e.blkaddr = ctx.blkaddr;
>  	}


  reply	other threads:[~2023-03-01 13:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28 18:54 [PATCH 1/3] erofs-utils: get rid of useless nr_dup Gao Xiang
2023-02-28 18:54 ` [PATCH 2/3] erofs-utils: use compressed pclusters to mark fragments Gao Xiang
2023-03-01 14:00   ` Yue Hu [this message]
2023-02-28 18:54 ` [PATCH 3/3] erofs-utils: add `-Eall-fragments` option Gao Xiang
2023-03-01 11:21   ` Yue Hu
2023-03-01 11:05 ` [PATCH 1/3] erofs-utils: get rid of useless nr_dup Yue Hu

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=20230301220006.00007467.zbestahu@gmail.com \
    --to=zbestahu@gmail.com \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=zhangwen@coolpad.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