revoke_delegation(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:

  1. From the administrative interface, nfsd4_revoke_states, which is revoking a specific delegation stateid.
  2. 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 dp state is SC_STATUS_FREED, that means a FREE_STATEID operation 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 dp state isn't marked SC_STATUS_FREED, that means we need to place it on the cl_revoked list and wait for the FREE_STATEID to 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:


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