-
Notifications
You must be signed in to change notification settings - Fork 269
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
WriteRequest differences between OSX and Linux #44
Comments
Update: I commented out the t.Skip, and see both failures and successes. Digging deeper.
|
Both failing and successful test runs write 0..N bytes at offset 0, with N increasing on every write. That is, userspace adds one more byte at the end of the page cache entry, kernel flushes the page to permanent storage.
That's 994 bytes at offset 0, 995 bytes at offset 0, etc. I don't see a difference on the FUSE level, currently. |
Alright this looks like a reasonable explanation. From other logged data, we know that in the below snippet the write of 577 bytes has "good" data, where as the write with 578 bytes is 577 zeroes and 1 byte of good data at the end.
So, if the attribute cache expires (usual TTL is 1 minute, as seen in AttrValid above), and the kernel re-requests attributes from your fs, you reply with "Size: 0", and this causes the kernel to truncate the file to size 0. File contents are now "", size 0. New write comes in, saying write a byte to offset 578, the kernel expands the file to 578 bytes (with zeroes) and writes that byte. |
Very interesting... So the issue is that an incorrect size is being returned from Attr between writes? |
Yup. I have no idea how to get the right file size correctly for a potentially open file in ipns, but making ipns_unix.go Node.Attr have
with a helper function
has resulted in no failures yet when running the test in a tight loop. |
Other items to note:
|
Documentation aspects filed as #47 Please open new, specific, issues if you can think of a specific thing that really needs to be better explained. "Better docs" is too vague to deserve an issue. As far as I see, there is no bug left here, just subtle VFS behavior. And bazil.org/fuse doesn't get to dictate the rules for that, so that's not mine to fix, merely to document. |
@tv42 awesome, thank you very much! (haven't verified but makes sense to me!) |
I have a test that tests writing to a fuse filesystem one byte at a time. This test passes in linux, but does not in OSX. Inspecting it further, i see that the write requests in linux are [Offset = i, Size = 1], but on OSX they are [Offset = 0, Size = i] where i is 0 to N. Is t Is this expected behaviour? or is this a bug?
The text was updated successfully, but these errors were encountered: