Repository navigation
Conversation
Let NFSv4 owners through the backend range gate, and carry the backend tokens on the NFS lock records so that merging, carving and unlocking release them. NLM locks stay node-local. A partial LOCKU does not yet shrink the backend lock. Signed-off-by: Amit Kumar <akamit91@hotmail.com>
A LOCK that downgrades or splits a held range no longer releases the old backend record before the new pieces are in place. The surviving pieces are projected onto the same backend token, and the retired tokens are released only after the LOCK reply is ready, so the range is not left unheld during the regrant. LOCKT asks the backend as well as the local claim table, so a conflict held on another node is reported with its range. The owner stays empty in the DENIED reply because the backend does not carry it. LOCKU and LOCK on the same lock state exclude each other in both directions. LOCKU returns NFS4ERR_DELAY while a LOCK is still pinned on that state, and a LOCK is refused its pin while a LOCKU walk runs. On DELAY the seqid and the ranges are left untouched, so the client retries. Tests cover downgrade and re-lock projection and LOCK denial by another owner in the relock probe, and the LOCKU gate in the state table test. Signed-off-by: Amit Kumar <akamit91@hotmail.com>
A LOCK or regrant can be answered by the claim layer on any thread, but the reply has to go out on the request's own evpl. Route the completion through nfs4_cb_defer_to_thread, which reuses the callback doorbell queue, so the reply is always built on the owning thread. A backend range confirm that fails with an error now denies only the requested range. Before, the conflict was reported as the whole file, which misreported the file as locked. If the server cannot remember a carried range token, it aborts instead of releasing the backend record. Releasing it would hand the bytes to other nodes while the local lease still holds them. Signed-off-by: Amit Kumar <akamit91@hotmail.com>
Upstream added nfs4_thread_run, the same cross-thread completion helper this series introduced as nfs4_cb_defer_to_thread. Take the upstream version and point the regrant and lock completion call sites at it. Keep both the LOCKU/LOCK pin gate test and the upstream layout stateid test. Signed-off-by: Amit Kumar <akamit91@hotmail.com>
Quick-tier test coverage
make coverage CTEST_ARGS="--output-on-failure"Coverage of this pull request's changes
Changed lines the quick-tier tests never executed: Executed by the quick-tier tests ( |
A LOCKU replied as soon as the local lease dropped its ranges, but the backend release is queued on the claim layer and can finish later. A client that saw the unlock succeed could then be refused a LOCK on the same bytes from another node, because the backend record still existed. The LOCKU now arms a release-wait counter. Each queued backend release takes a reference on it, and the owner reference taken at arm time is dropped once the walk finishes. The last reference to drop completes the compound on the request's thread through nfs4_thread_run. The v4.0 seqid replay record is still written synchronously, so a retry sent while the release is pending gets the same answer. Signed-off-by: Amit Kumar <akamit91@hotmail.com>
This branch has not been deployed
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.
NFSv4 byte-range locks are now confirmed with the backend before the LOCK reply is sent. A lock taken through NFSv4 is therefore also held at the backend, where other nodes can see it. The change is three commits on top of upstream main.
nfs4: project range locks to the backend claim layerlets NFSv4 owners through the backend range gate. The backend token is carried on the lock records, so merging, carving and unlocking release the backend record too. NLM locks stay node-local.nfs4: carry lock regrants and LOCKT through the backend range gateprojects the surviving pieces of a downgrade or split onto the same token, and releases the retired tokens only after the LOCK reply is ready, so the range is never unheld during a regrant. LOCKT asks the backend as well as the local claim table. LOCKU and LOCK on the same lock state exclude each other: LOCKU returns NFS4ERR_DELAY while a LOCK is pinned on that state, and a LOCK is refused its pin while a LOCKU walk runs.nfs4: finish lock completions on the request's threadruns the LOCK reply and the regrant finish on the request's own thread. Backend answers can arrive on any thread, and the reply has to go out on the owning evpl. A backend range-confirm error now denies only the requested range; before, it was reported as a whole-file conflict. If the server cannot remember a carried range token, it aborts rather than releasing the backend record while the local lease still holds those bytes.Known limits:
Testing:
make syntax,sdk-include-check,build_debugandbuild_clangpass.-j) fails intermittently with "Subprocess aborted", on this branch and on the unmodified base, so it is not used as the gate here.reuse-lintfails on the base as well, becauseext/specs/REUSE.tomland.reuse/dep5both exist.copyright-checkcannot run in the devcontainer:etc/copyright-year.shusesgit diff --merge-base, which the container's git rejects, so no header is checked.