]> git.baikalelectronics.ru Git - uboot.git/commit
Fix squashfs failing to load sparse files
authorCampbell Suter <campbell@snapit.group>
Mon, 23 Nov 2020 02:40:03 +0000 (15:40 +1300)
committerTom Rini <trini@konsulko.com>
Wed, 20 Jan 2021 19:01:44 +0000 (14:01 -0500)
commitecbd59bf4f899de92daf98c810cf27ddb81ea712
tree993e262d50a903b112a025f4e5d169407476fa81
parented72e492519143f6a4f5b8758e1fe9deb12f9788
Fix squashfs failing to load sparse files

SquashFS supports sprase blocks in files - that is, if a given block is
composed only of zeros, it's not written to the output file to save
space and it's on-disk length field is set to zero to indicate that.

Previously the squashfs driver did not recognise that, and would attempt
to read and decompress a zero-sized block, which obviously failed.

The following command may be used to create a file for testing:

cat <(dd if=/dev/urandom of=/dev/stdout bs=1M count=1) \
<(dd if=/dev/zero of=/dev/stdout bs=1M count=1) \
<(dd if=/dev/urandom of=/dev/stdout bs=1k count=200) >test_file

Signed-off-by: Campbell Suter <campbell@snapit.group>
fs/squashfs/sqfs.c