Repository navigation
nfs4: allow to disable open delegations per export - #177
Merged
Merged
Conversation
Motivation:
Since the adaptive delegation heuristic was added, the server offers read
delegations whenever a client has a working callback channel, and there is
no way for an administrator or embedder to turn that off. Not all clients
cope well with delegation recalls, and as delegations are voluntary on the
server side (rfc8881 10.2), whether to offer them is a deployment
decision. As it depends on the client, it belongs into the export
definition rather than into a global switch.
Modification:
add a 'deleg'/'nodeleg' export option, enabled by default, and consult it
in OperationOPEN the same way OperationLAYOUTGET consults 'pnfs'.
FileTracker#addOpen gets an overload taking the export's decision; the
existing signature is kept and defaults to allowing delegations, so the
behaviour of existing deployments and embedders is unchanged. Add tests
for parsing the option and for the gating in FileTracker.
Result:
open delegations can be disabled for selected clients, e.g.
/export 10.0.0.0/24(rw,deleg) 192.168.1.5(rw,nodeleg)
Fixes: dCache#176
Target: master
Signed-off-by: Yves Langisch <yla@iterate.ch>
kofemann
reviewed
Sep 1, 2026
Motivation: The previous commit kept the old five argument version of FileTracker#addOpen to stay backward compatible. As pointed out in the review, it has no callers outside of the tests, and the public API is explicitly unstable between minor releases. Modification: remove the old method and update the remaining callers in the unit tests and in FileTrackerBenchmark. Record the signature change in API-changes.md. Result: one way to register an open, no unused code path. Suggested-by: Tigran Mkrtchyan Target: master Signed-off-by: Yves Langisch <yla@iterate.ch>
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.
Implements the export-option approach suggested in #176.
A new export option
deleg/nodeleg(enabled by default) controls whether the server may hand out open delegations to clients matching that export:OperationOPENconsults the export the same wayOperationLAYOUTGETconsultspnfs, and passes the result toFileTracker#addOpen. The existing 5-argumentaddOpensignature is kept and defaults to allowing delegations, so nothing changes for existing deployments or for embedders calling it directly. Only the granting of new delegations is gated; recall, return and revocation are untouched.Tests cover parsing of
deleg/nodeleg/no_delegand the default, plus the gating itself: with a callback channel present andOPEN4_SHARE_ACCESS_WANT_READ_DELEGset, no delegation is granted when the export disallows it.Two points I would like your opinion on:
isDelegationAllowed()returnstruewhen the context has no export table at all, which is a supported configuration for a pNFS data server (NFSServerV41sets the DS role when_exportTable == null).isPnfsAllowed()can dereference the table unconditionally because LAYOUTGET is an MDS operation; OPEN is not, hence the extra check. Let me know if you would rather handle that differently.ExportTable) instead of havingOperationOPENpass the decision in? I kept it in the operation because that is where the other export options are evaluated, and because the export lookup then uses the address of the current connection rather than the one recorded at client creation.Not addressed here: when a client explicitly asks for a delegation on a
nodelegexport, the reply still reportsWND4_NOT_WANTED/WND4_RESOURCE. Happy to add a more accuratewhy_no_delegation4in a follow-up if you have a preference which one fits.