linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gao Xiang <xiang@kernel.org>
To: Daeho Jeong <daeho43@gmail.com>
Cc: Daeho Jeong <daehojeong@google.com>,
	linux-erofs@lists.ozlabs.org, Jaegeuk Kim <jaegeuk@kernel.org>,
	Gao Xiang <hsiangkao@linux.alibaba.com>,
	miaoxie@huawei.com, Wang Qi <mpiglet@outlook.com>
Subject: Re: [PATCH] erofs-utils: introduce fsck.erofs
Date: Fri, 29 Oct 2021 06:20:20 +0800	[thread overview]
Message-ID: <20211028221812.GA16132@hsiangkao-HP-ZHAN-66-Pro-G1> (raw)
In-Reply-To: <CACOAw_y=-g-Lkk+wfd=fnQMdmAVQ22-jpKQo8kkB7D4o34uoSw@mail.gmail.com>

On Thu, Oct 28, 2021 at 10:10:03AM -0700, Daeho Jeong wrote:
> > > In fact, I wanted to decompress the whole data here. We can't check
> > > the data integrity,
> > > so I just wanted to check the layout of the file and that is the
> > > reason why I used z_erofs_map_blocks_iter() directly.
> >
> > Yeah, z_erofs_map_blocks_iter() here is good, yet I think we could
> > add a follow-up z_erofs_decompress() as well, at least it can verify
> > obvious compressed data corruption.
> 
> Could you enlighten me what is wrong with the below flow?
> z_erofs_decompress fails with -EIO or -EUCLEAN.
> 
>         raw = malloc(pchunk_len);
>         BUG_ON(!raw);
>         buffer = malloc(inode->i_size);
>         BUG_ON(!buffer);
> 
>         ret = dev_read(raw, 0, pchunk_len);
>         if (ret < 0) {
>                 erofs_err("an error occurred when reading compressed data "
>                           "of nid(%llu): errno(%d)", inode->nid | 0ULL, ret);
>                 goto out;
>         }
> 
>         ret = z_erofs_decompress(&(struct z_erofs_decompress_req) {
>                                 .in = raw,
>                                 .out = buffer,
>                                 .decodedskip = 0,
>                                 .inputsize = pchunk_len,
>                                 .decodedlength = inode->i_size,

I guess try to pass map.m_llen here? since we need to decode pcluster
one-by-one....

Thanks,
Gao Xiang

>                                 .alg = algorithmformat,
>                                 .partial_decoding = 0
>                                  });

  reply	other threads:[~2021-10-28 22:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25 19:48 [PATCH] erofs-utils: introduce fsck.erofs Daeho Jeong
2021-10-25 23:24 ` Gao Xiang
2021-10-26  2:42   ` Guo Xuenan
2021-10-26  3:12     ` Gao Xiang
2021-10-26 11:34   ` Guo Xuenan
2021-10-26 18:40     ` Daeho Jeong
2021-10-26 18:35   ` Daeho Jeong
2021-10-27  3:13     ` Gao Xiang
2021-10-28  0:50       ` Daeho Jeong
2021-10-28  1:00         ` Gao Xiang
2021-10-28 17:10           ` Daeho Jeong
2021-10-28 22:20             ` Gao Xiang [this message]
2021-10-28 22:25               ` Daeho Jeong

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=20211028221812.GA16132@hsiangkao-HP-ZHAN-66-Pro-G1 \
    --to=xiang@kernel.org \
    --cc=daeho43@gmail.com \
    --cc=daehojeong@google.com \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=miaoxie@huawei.com \
    --cc=mpiglet@outlook.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;
as well as URLs for NNTP newsgroup(s).