Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get the squashfs functionality working #784

Closed
escalade opened this issue Aug 8, 2017 · 3 comments
Closed

Can't get the squashfs functionality working #784

escalade opened this issue Aug 8, 2017 · 3 comments

Comments

@escalade
Copy link

escalade commented Aug 8, 2017

I've tried patching both 4.12.5 and 4.13-rc4. The patches apply cleanly and I've set CONFIG_SQUASHFS_ZSTD=y, CONFIG_XXHASH=y and CONFIG_ZSTD_DECOMPRESS=y.

I've used the squashfs toold from here, it compiles fine and I've successfully created the squashfs.

When I mount I just get mounting failed input/output error. In dmesg I've spotted this:

[ 4377.243871] SQUASHFS error: Failed to initialize zstd decompressor [ 4377.243872] SQUASHFS error: zstd decompression failed, data probably corrupt [ 4377.243873] SQUASHFS error: squashfs_read_data failed to read block 0x28b3d [ 4377.243874] SQUASHFS error: Unable to read metadata cache entry [28b3d] [ 4377.243875] SQUASHFS error: Unable to read inode 0x106709e0

I did read that the kernel patches were meant for 4.10, am I wrong to expect them to work on 4.12+ or is it perhaps the squashfs tools that are creating corrupt filesystems?

Any comment is appreciated, and let me know if there's any more info needed.

@terrelln
Copy link
Contributor

terrelln commented Aug 8, 2017

Thanks for the report @escalade. I think I've spotted the bug, zstd_wrapper.c:83 should be

	stream = ZSTD_initDStream(max_t(size_t, msblk->block_size, SQUASHFS_METADATA_SIZE), wksp->mem, wksp->mem_size);

It must have been exposed when I added some extra tables to the ZSTD_DCtx, which bumped the window size over a power of 2 boundary. I'll update you when I've confirmed it.

@escalade
Copy link
Author

escalade commented Aug 8, 2017

That was fast :)

@terrelln
Copy link
Contributor

terrelln commented Aug 8, 2017

I've confirmed the fix, thanks again for the report. I'll update the patches here and on the mailing lists. I'll also add the squashfs-tools patch to the zstd repo. The patches are now tested on the master branch, I'll remove that outdated comment about 4.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants