fs/squashfs: Set ret to 0 on successful read
PATCH 1/1 fs/squashfs: Set ret to 0 on successful read
It might still be a positive number due to the call to sqfs_disk_read. This only happens when reading a file from an uncompressed squashfs.
I found this by trying to boot using the extlinux bootmethod, where positive values are treated as errors.
---
fs/squashfs/sqfs.c | 2 ++ 1 file changed, 2 insertions(+)
fs/squashfs/sqfs.c +2 -0
@@ -1636,6 +1636,8 @@ static int sqfs_read_nest(const char *filename, void *buf, loff_t offset, *actread = finfo.size; } + ret =0 ; + out:free (fragment);free (datablock);
Signature · 4 lines
2.53.0 base-commit: e3405917a1806971d9e72a94186b299f05581e1a branch: squashfs-fix
Hi Michael,
Le 20/04/2026 à 18:35, Michael Zimmermann a écrit :
Quoted 7 lines
It might still be a positive number due to the call to
sqfs_disk_read. This only happens when reading a file from an uncompressed squashfs.I found this by trying to boot using the extlinux bootmethod, where positive values are treated as errors.
Signed-off-by Michael Zimmermann <[email protected]>
Good catch!
Quoted 10 lines
---
fs/squashfs/sqfs.c | 2 ++ 1 file changed, 2 insertions(+)fs/squashfs/sqfs.c +0
-0
fs/squashfs/sqfs.c static int sqfs_read_nest(const char *filename, void *buf, loff_t offset, · line 1643
Quoted 8 lines
fs/squashfs/sqfs.c +2
-0@@ -1636,6 +1636,8 @@ static int sqfs_read_nest(const char *filename, void *buf, loff_t offset, *actread = finfo.size; } + ret =0 ; + out:free (fragment);free (datablock);
Thanks!
Regards,
Richard
Quoted 5 lines · Michael Zimmermann
fs/squashfs: Set ret to 0 on successful read
It might still be a positive number due to the call to
sqfs_disk_read. This only happens when reading a file from an uncompressed squashfs.
Quoted 7 lines
I found this by trying to boot using the extlinux bootmethod, where positive values are treated as errors.
Signed-off-by Michael Zimmermann <[email protected]>
fs/squashfs/sqfs.c| 2 ++1 file changed, 2 insertions(+)
Quoted 8 lines · Michael Zimmermann
It might still be a positive number due to the call to
sqfs_disk_read. This only happens when reading a file from an uncompressed squashfs.I found this by trying to boot using the extlinux bootmethod, where positive values are treated as errors.
[...]
Applied to u-boot/master, thanks!
[1/1] fs/squashfs: Set ret to 0 on successful read
commit: 30885b01aaa4bcdfa3fee9ca3066d3af563e6688
Signature · 1 line
Tom