-
Notifications
You must be signed in to change notification settings - Fork 255
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
Panic on readling some file. #145
Comments
It crashes on a READ request with size 393216 bytes = 384 kiB:
This is a buffer overrun - the Linux kernel limits the requests to 128 kiB and this is the size of the buffer - is this on MacOS? |
It is on a NAS machine from synology, which is Linux 3.10.102 #15152 SMP Fri Oct 6 18:13:48 CST 2017 x86_64 GNU/Linux synology_cedarview_1813+. The hash different error below is not fully checked, we should focus on the
|
Which should I enlarge ? |
This is a kernel constant, FUSE_MAX_PAGES_PER_REQ. You can only change it in the kernel source code and compile yourself. Which seems to be what Synology has done, probably to improve performance with NTFS (the ntfs-3g driver is FUSE-based). I will fix this in gocryptfs. We will probably not take advantage of the larger request size, but we should not crash. |
Our byte cache pools are sized acc. to MAX_KERNEL_WRITE, but the running kernel may have a higher limit set. Clamp to what we can handle. Fixes a panic on a Synology NAS reported at #145
Fix pushed as 3009ec9 |
Do you still get the crash? If not we can focus on the hash mismatch. |
No crash now. |
Ok good. Closing this. |
We cannot return less data than requested to the kernel! From https://libfuse.github.io/doxygen/structfuse__operations.html: Read should return exactly the number of bytes requested except on EOF or error, otherwise the rest of the data will be substituted with zeroes. Reverts commit 3009ec9 minus the formatting improvements we want to keep. Fixes #147 Reopens #145
We use fixed-size byte slice pools (sync.Pool) and cannot handle larger requests. So ask the kernel to not send bigger ones. Fixes #145
gocryptfs v1.4.1-19-g64e5906 without_openssl; go-fuse v20170619-16-gbd6c960; 2017-10-09 go1.6.2
gocryptfs -reverse /volume1/dsG /tmp/dsg cd /tmp/ gocryptfs -ro -fg -fusedebug ./dsg ./t
Commands:
Log:
The text was updated successfully, but these errors were encountered: