]> Git Repo - u-boot.git/commit
fs/squashfs: fix reading of fragmented files
authorJoao Marcos Costa <[email protected]>
Mon, 17 May 2021 21:20:38 +0000 (18:20 -0300)
committerTom Rini <[email protected]>
Thu, 10 Jun 2021 00:58:20 +0000 (20:58 -0400)
commit0008d8086649d3bb3afd0c4697f5b73ccf6f293d
tree8572f724010c17e834adfe1e6f01f8712a204736
parent46704165f53a7e324b95313e20e928c3a8b93261
fs/squashfs: fix reading of fragmented files

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 <[email protected]>
Tested-by: Richard Genoud <[email protected]>
Reviewed-by: Miquel Raynal <[email protected]>
fs/squashfs/sqfs.c
This page took 0.032457 seconds and 4 git commands to generate.