[PATCH] fs/squashfs: fix reading of fragmented files
Tom Rini
trini at konsulko.com
Thu Jun 10 02:58:41 CEST 2021
On Mon, May 17, 2021 at 06:20:38PM -0300, Joao Marcos Costa wrote:
> 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.
>
> 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 at gmail.com>
> Tested-by: Richard Genoud <richard.genoud at posteo.net>
> Reviewed-by: Miquel Raynal <miquel.raynal at bootlin.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210609/ee3293db/attachment.sig>
More information about the U-Boot
mailing list