linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Li GuiFu via Linux-erofs <linux-erofs@lists.ozlabs.org>
To: Gao Xiang <xiang@kernel.org>,
	linux-erofs@lists.ozlabs.org, Li Guifu <bluce.liguifu@huawei.com>
Subject: Re: [PATCH v4 4/5] erofs-utils: zero out garbage trailing data for non-0padding cases
Date: Sat, 1 May 2021 00:17:24 +0800	[thread overview]
Message-ID: <ea990fb8-1aae-b697-b766-aab8592f46d2@aliyun.com> (raw)
In-Reply-To: <20210430040345.17120-4-xiang@kernel.org>



On 2021/4/30 12:03, Gao Xiang wrote:
> When "-E legacy-compress" is used, lz4 0padding feature will be
> disabled by default in order to support old kernels (< Linux v5.3).
> 
> In that case, the current mkfs leaves previous garbage data after
> valid compressed data if the length becomes shorter. This doesn't
> matter for kernels >= v5.0 since LZ4_decompress_safe_partial() is used.
> 
> However, for staging erofs v4.19, it used an in-house customized
> lz4 implemention due to LZ4_decompress_safe_partial() didn't work
> as expected at that time, yet it doesn't allow trailing random
> data in practice or decompression failure could happen.
> 
> I don't think it really matters since "obsoleted_mkfs" works perfectly
> for such old staging versions (v4.19). Anyway, trailing garbage data
> sounds unreasonable, so let's zero out it now.
> 
> Fixes: 66653ef10a7f ("erofs-utils: introduce compression for regular files")
> Signed-off-by: Gao Xiang <xiang@kernel.org>
> ---
>  lib/compress.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
It looks good
Reviewed-by: Li Guifu <bluce.lee@aliyun.com>

Thanks,

  reply	other threads:[~2021-04-30 16:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30  4:03 [PATCH v4 1/5] erofs-utils: sync up with in-kernel erofs_fs.h Gao Xiang
2021-04-30  4:03 ` [PATCH v4 2/5] erofs-utils: warn out experimental big pcluster Gao Xiang
2021-04-30 16:16   ` Li GuiFu via Linux-erofs
2021-04-30  4:03 ` [PATCH v4 3/5] erofs-utils: manpage: add missing -C option for " Gao Xiang
2021-04-30 16:16   ` Li GuiFu via Linux-erofs
2021-04-30  4:03 ` [PATCH v4 4/5] erofs-utils: zero out garbage trailing data for non-0padding cases Gao Xiang
2021-04-30 16:17   ` Li GuiFu via Linux-erofs [this message]
2021-04-30  4:03 ` [PATCH v4 5/5] erofs-utils: manpage: add manual for erofsfuse Gao Xiang
2021-04-30 16:17   ` Li GuiFu via Linux-erofs

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=ea990fb8-1aae-b697-b766-aab8592f46d2@aliyun.com \
    --to=linux-erofs@lists.ozlabs.org \
    --cc=bluce.lee@aliyun.com \
    --cc=bluce.liguifu@huawei.com \
    --cc=xiang@kernel.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;
as well as URLs for NNTP newsgroup(s).