nfsd: validate NFS open state without share reservations - #144
Open
stevephodgson wants to merge 1 commit into
Open
nfsd: validate NFS open state without share reservations#144stevephodgson wants to merge 1 commit into
stevephodgson wants to merge 1 commit into
Conversation
pynfs CLOSE3/5/6 and OPCF1/4/5/6 showed that CLOSE and OPEN_CONFIRM accepted bad owner seqids and invalid stateid generations. RD10/11 accepted stale and old stateids, while SATT4 resized through a read-only open. Track open owners and stateid generations in memory, validate WRITE, READ, CLOSE, OPEN_CONFIRM, and SETATTR(SIZE), preserve OPEN and CLOSE replay behavior, and recover CLOSE for staged files after an nfsd restart. This adds new state (openStateStore), but it is server-local and in-memory only, not durable or shared across nfsd instances. That is acceptable because a write-open's actual data (the staging file it protects) is itself local-disk and per-host already; a write-open cannot outlive its host regardless of what nfsd tracks about it, so persisting the open state anywhere more durable than the staging file it describes would not add any real guarantee. Add unit tests to cover the anonymous special stateid handling. Do not retain or enforce share-deny reservations. They do not match TernFS last-closer-wins semantics and would only be consistent within one nfsd process.
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.
pynfs CLOSE3/5/6 and OPCF1/4/5/6 showed that CLOSE and OPEN_CONFIRM accepted bad owner seqids and invalid stateid generations. RD10/11 accepted stale and old stateids, while SATT4 resized through a read-only open.
Track open owners and stateid generations in memory, validate WRITE, READ, CLOSE, OPEN_CONFIRM, and SETATTR(SIZE), preserve OPEN and CLOSE replay behavior, and recover CLOSE for staged files after an nfsd restart.
This adds new state (openStateStore), but it is server-local and in-memory only, not durable or shared across nfsd instances. That is acceptable because a write-open's actual data (the staging file it protects) is itself local-disk and per-host already; a write-open cannot outlive its host regardless of what nfsd tracks about it, so persisting the open state anywhere more durable than the staging file it describes would not add any real guarantee.
Add unit tests to cover the anonymous special stateid handling.
Do not retain or enforce share-deny reservations. They do not match TernFS last-closer-wins semantics and would only be consistent within one nfsd process.