public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Joao Marcos Costa <jmcosta944@gmail.com>
Cc: u-boot@lists.denx.de, thomas.petazzoni@bootlin.com,
	richard.genoud@posteo.net
Subject: Re: [PATCH] fs/squashfs: fix reading of fragmented files
Date: Wed, 26 May 2021 09:52:24 +0200	[thread overview]
Message-ID: <20210526095224.17f2e3f8@xps13> (raw)
In-Reply-To: <20210517212038.117284-1-jmcosta944@gmail.com>

Hi Joao,

Joao Marcos Costa <jmcosta944@gmail.com> wrote on Mon, 17 May 2021
18:20:38 -0300:

> The fragmented files were not correctly read because of two issues:
> 
> - The squashfs_file_info struct has a field named 'comp', which tells if
> the file's fragment is compressed or not. This field was always set to
> 'true' in sqfs_get_regfile_info and sqfs_get_lregfile_info. It should
> actually take sqfs_frag_lookup's return value. This patch addresses
> these two assignments.
> 
> - In sqfs_read, the fragments (compressed or not) were copied to the
> output buffer through a for loop which was reading data at the wrong
> offset. Replace these loops by equivalent calls to memcpy, with the
> right parameters.

Good idea to get rid of these memcpy of 1 byte :)

> I tested this patch by comparing the MD5 checksum of a few fragmented
> files with the respective md5sum output in sandbox, considering both
> compressed and uncompressed fragments.
> 
> Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com>

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

But next time, when you fix two issues (even if they fix the same
feature) please provide two patches ;)

Thanks,
Miquèl

  parent reply	other threads:[~2021-05-26  7:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 21:20 [PATCH] fs/squashfs: fix reading of fragmented files Joao Marcos Costa
2021-05-20  9:54 ` Richard Genoud
2021-05-20 12:51   ` João Marcos Costa
2021-05-26  7:52 ` Miquel Raynal [this message]
2021-05-26 12:35   ` João Marcos Costa
2021-06-09 13:16     ` João Marcos Costa
2021-06-09 17:40       ` Tom Rini
2021-06-09 18:21         ` João Marcos Costa
2021-06-09 18:32           ` João Marcos Costa
2021-06-09 18:48           ` Tom Rini
2021-06-10  0:58 ` Tom Rini

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=20210526095224.17f2e3f8@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=jmcosta944@gmail.com \
    --cc=richard.genoud@posteo.net \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=u-boot@lists.denx.de \
    /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