fh_verify(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fh_verify(9) β€” like, the Kernel API Manual's main character ✨

okay bestie, welcome to the <pink>Kernel API Manual</pink> entry for fh_verify(9) β€” the filehandle lookup + access-checking queen πŸ‘‘. she's lowkey everywhere in nfsd and honestly? she ate. let's get into it πŸŽ€


✨ NAME ✨

fh_verify β€” filehandle lookup and access checking, fr fr πŸ¦‹


🌸 SYNOPSIS 🌸

__be32 fh_verify (struct svc_rqst *rqstp , struct svc_fh *fhp , umode_t
type , int access );

like, yes, that's the whole signature, no cap πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • rqstp β€” pointer to the current rpc request 🫢 that's the vibe context.
  • fhp β€” the filehandle to be verified πŸ” the thing we're checking, periodt.
  • type β€” the expected type of the object that filehandle points to πŸ‘€
  • access β€” the type of access needed to that object, iykyk πŸ”‘

πŸ’– DESCRIPTION πŸ’–

so what she does is: look up a dentry from the on-the-wire filehandle, check the client's access to the export, and set the current task's credentials. all three, one function, main character energy 🌈

⚠️ okay important bestie: regardless of success or failure of fh_verify, fh_put should be called on fhp when the caller is finished with the filehandle. success, fail, whatever β€” you still call fh_put. no skipping πŸ’€

fh_verify may be called multiple times on a given filehandle β€” for example, when processing an NFSv4 compound 🧚 the first call will look up a dentry using the on-the-wire filehandle. subsequent calls will skip the lookup and just perform the other checks and possibly change the current task's credentials. so she's efficient, she remembers, she doesn't redo the lookup. obsessed ✨

type specifies the type of object expected, using one of the S_IF* constants defined in include/linux/stat.h πŸ“ the caller may use zero to indicate that it doesn't care (mood, honestly), or a negative integer to indicate that it expects something not of the given type πŸ™ˆ like, "literally anything but that, please."

access is formed from the NFSD_MAY_* constants defined in fs/nfsd/vfs.h ⭐ that's where the permission vibes come from.


πŸ¦‹ SEE ALSO πŸ¦‹

go read those too, bestie, they're all in the same friend group πŸ’…


and that's the page!! sourced from <purple>./fs/nfsd</purple>, dated <cyan>October 2026</cyan>, and it's the fh_verify(9) entry β€” mwah, stan her, bye πŸ“πŸ’œ

πŸ“¦ where this page comes from