nfsd4_scsi_d...layoutupdate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ nfsd4_scsi_decode_layoutupdate(9) ✨

okay so this is a page from the Kernel API Manual, bestie β€” it's giving very "deep in the NFS server code" energy and honestly? kinda iconic. it's all about decoding the scsi layout extent array. let's get into it πŸ’…


🌸 NAME 🌸

nfsd4_scsi_decode_layoutupdate β€” decodes the scsi layout extent array. that's it, that's the whole vibe ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

__be32 nfsd4_scsi_decode_layoutupdate (struct xdr_stream *xdr , struct
       iomap **iomapp , int *nr_iomapsp , u32 block_size );

like, look at that signature. it ate. πŸ”₯


πŸŽ€ ARGUMENTS πŸŽ€

  • xdr β€” the subbuf that's been set to the encoded array. it's the raw material, bestie 🫢
  • iomapp β€” pointer where the decoded extent array gets stored. it's literally the destination πŸ’–
  • nr_iomapsp β€” pointer where the number of extents gets stored. somebody's gotta keep count πŸ‘‘
  • block_size β€” the alignment of the extent offset and length. yes, alignment MATTERS, we'll get there 😭

🌈 DESCRIPTION 🌈

okay so here's the tea β˜• β€” this function decodes the opaque field of the layoutupdate4 structure inside a layoutcommit request, specifically for the scsi layout driver. and that field? it's actually an array of extents, sent over by the client. no cap.

it also checks that the offset and length of each extent are aligned by block_size. so if the client sends you something all unaligned and messy, this function is gonna notice and it is NOT gonna be chill about it πŸ™ˆ

Return values β€” the vibe check results, in order: - nfs_ok β€” successful decoding, and iomapp and nr_iomapsp are valid. slay πŸ’… - nfserr_bad_xdr β€” the encoded array in xdr is invalid. bad data, blocked 🚫 - nfserr_inval β€” an unaligned extent was found. told you alignment mattered 😭 - nfserr_delay β€” failed to allocate memory for iomapp. the memory said no 🫠

🧚 SEE ALSO 🧚


lowkey that's the whole page!! from ./fs/nfsd, dated October 2026, and yes the page header said nfsd4_scsi_d...layoutupdate(9) β€” the ellipsis is doing main character energy fr fr πŸ’€ go forth and decode those extents, bestie πŸ’œπŸŒΈ
πŸ“¦ where this page comes from