revoke_delegation(9)
π revoke_delegation β like, the Kernel API Manual page, bestie β¨
Okay so welcome to revoke_delegation(9), a page about doing nfs4 delegation structure cleanup. Yes it sounds dry. No it's not. Sit down, grab a strawberry π, we're learning.
πΈ NAME πΈ
revoke_delegation β performs nfs4 delegation structure cleanup, and honestly? it's giving janitor energy and I respect it π
β¨ SYNOPSIS β¨
void revoke_delegation (struct nfs4_delegation *dp );
That's it. That's the whole signature. Iconic, lowkey.
π ARGUMENTS π
dpβ pointer to the delegation, aka the main character of this whole function π«Ά
π¦ DESCRIPTION π¦
So here's the vibe check fr fr. This function assumes it's being called from one of two places, and it is not here to double-check your work:
- From the administrative interface,
nfsd4_revoke_states, which is revoking a specific delegation stateid. - From a laundromat thread,
nfsd4_landromat, which determined that this specific state has expired and needs to be revoked.
Both of those mark the state with the appropriate stid sc_status mode, iykyk. It is also assumed that a reference was taken on the dp state β and heads up, this function consumes that reference. So like, it's yours no more. Gone. Consumed. π
Now the fun part, the actual branching π:
- If this function finds that the
dpstate isSC_STATUS_FREED, that means aFREE_STATEIDoperation for this stateid has already been processed, and we can proceed to removing it from the recalled list. Slay, we're basically done. - But if the
dpstate isn't markedSC_STATUS_FREED, that means we need to place it on thecl_revokedlist and wait for theFREE_STATEIDto arrive from the client. So we're waiting. Patiently. π§
At the same time, we need to mark it as SC_STATUS_FREEABLE to indicate to the nfsd4_free_stateid function that this stateid has already been added to the cl_revoked list, and that nfsd4_free_stateid is now responsible for removing it from the list. Passing the baton, periodt. π₯
Inspection of where the delegation state is in the revocation process is protected by the clp->cl_lock. Take that lock seriously, bestie, it's the vibe check for concurrency π
π SEE ALSO π
Kernel file ./fs/nfsd/nfs4state.c, plus the whole friend group:
nfs4_delegation_exists(9)hash_delegation_locked(9)nfs4_replay_free_cache(9)nfsd4_revoke_states(9)nfsd4_revoke_export_states(9)nfsd_slot_shrinker_count(9)nfsd_slot_shrinker_scan(9)nfsd4_put_client(9)nfsd_wait_for_delegreturn(9)nfsd_breaker_owns_lease(9)nfsd4_deleg_lm_open_conflict(9)nfsd4_process_open2(9)nfsd4_force_end_grace(9)nfs4_preprocess_stateid_op(9)nfs4_preprocess_seqid_op(9)nfsd4_release_lockowner(9)nfsd4_vet_deleg_time(9)nfsd4_deleg_getattr_conflict(9)nfsd_get_dir_deleg(9)nfsd_update_cmtime_attr(9)
Quick reminder bestie: this page lives at ./fs/nfsd and it's dated October 2026 β so mark your calendar, mwah π That's the whole page, go take a delegation reference and consume it responsibly, ily! π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms