-
Notifications
You must be signed in to change notification settings - Fork 121
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
SquashFS reading is not consistent with writing for large writing #282
Comments
Good catch. I took your sample and adapted it for tests, added it to #284, which will fail for now. Then we can fix. Any ideas why? |
Since we do read files from an existing squashfs without issues, my guess is the finalizing. But I am not 100% sure, as I am not sure that we read really large files. |
Update: I added a test for reading the large zeroed file, and it is reading correctly. So it should be the writing (i.e. finalizing). Any insights? |
I think so. If a file is larget than sector size, the error might happen |
https://dr-emann.github.io/squashfs/squashfs.html#_file_inodes Due to SquashFS spec, file inode's 'blocks start' field means the offset from the beginning of the file. This commit also fixes the fragmentData location calculation. Finally, due to Spec, if a file does not have fragment data, its frag index should be all 0xF. Fixes diskfs#282 Signed-off-by: Xynnn007 <[email protected]>
https://dr-emann.github.io/squashfs/squashfs.html#_file_inodes Due to SquashFS spec, file inode's 'blocks start' field means the offset from the beginning of the file. This commit also fixes the fragmentData location calculation. Finally, due to Spec, if a file does not have fragment data, its frag index should be all 0xF. Fixes diskfs#282 Signed-off-by: Xynnn007 <[email protected]>
When I use the following code to create a SquashFS image and try to write the contents of a file that exceeds the block size, I will find that when reading, I will read the contents of the super block, not just the file contents. If the length of the written data content is less than the block size, there will be no problem
Example
Result
Expected
Backup
If you comment out the longest input line and use
"123"
on the next line as the file content, the output is as expected.The text was updated successfully, but these errors were encountered: