Repository navigation
nfs3: set eof on a READ that ends at or past the end of the file - #186
Merged
Merged
Conversation
Motivation: NFSPROC3_READ_3 sets eof only when offset + count is exactly the file size. A READ that starts past the end returns 0 bytes with eof=false, although RFC 1813 says such a read is at eof. A client that still holds a larger, older size (Windows NFS client) then repeats that READ forever. Modification: Set eof when offset + count is equal to or greater than the size. Result: A READ at or past the end of the file reports eof. Target: master Signed-off-by: Rafael Hutter <r.hutter@moovit.de>
Member
|
@rafaelhutter Thank you for the contribution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
NFSPROC3_READ_3setseofonly whenoffset + count == size. A READ that starts past the end of the file returns 0 bytes witheof=false. RFC 1813 (READ3resok) says that such a read is at eof.A client that still holds an older, larger size for an open file repeats that READ forever. We see this with the Windows NFS client: it reads up to the size that it cached at open, gets 0 bytes and no eof, and asks again. The mount then hangs.
Modification
Set
eofwhenoffset + count >= size.Result
A READ at or past the end of the file reports eof. The new
NfsServerV3READ_3Testcovers a read before the end (no eof), a read up to the end (eof) and a read past the end (eof). Without this change, the past-the-end test fails.NFSv4 is not affected, because
OperationREADgets eof fromVirtualFileSystem.read.Target: master