u-boot/fs/squashfs
Joao Marcos Costa 0008d80866 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 <jmcosta944@gmail.com>
Tested-by: Richard Genoud <richard.genoud@posteo.net>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
2021-06-09 20:58:20 -04:00
..
Kconfig include/u-boot, lib/zlib: add sources for zlib decompression 2020-08-07 22:31:32 -04:00
Makefile fs/squashfs: new filesystem 2020-08-07 22:31:32 -04:00
sqfs.c fs/squashfs: fix reading of fragmented files 2021-06-09 20:58:20 -04:00
sqfs_decompressor.c fs/squashfs: add support for LZO decompression 2020-08-24 14:11:31 -04:00
sqfs_decompressor.h fs/squashfs: replace sqfs_decompress() parameter 2020-08-24 14:11:31 -04:00
sqfs_dir.c fs/squashfs: Fix Coverity Scan defects 2020-09-18 16:19:58 -04:00
sqfs_filesystem.h fs/squashfs: add support for ZSTD decompression 2020-08-24 14:11:31 -04:00
sqfs_inode.c fs/squashfs: Fix compilation error 2021-03-04 14:40:52 -05:00
sqfs_utils.h fs/squashfs: new filesystem 2020-08-07 22:31:32 -04:00