nfsd4_scsi_d...layoutupdate(9)
β¨ 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, andiomappandnr_iomapspare valid. slay π -nfserr_bad_xdrβ the encoded array inxdris invalid. bad data, blocked π« -nfserr_invalβ an unaligned extent was found. told you alignment mattered π -nfserr_delayβ failed to allocate memory foriomapp. the memory said no π«
π§ SEE ALSO π§
- the kernel file
./fs/nfsd/blocklayoutxdr.cβ go read the source, iykyk π nfsd4_block_encode_layoutget(9)nfsd4_block_decode_layoutupdate(9)
lowkey that's the whole page!! from./fs/nfsd, dated October 2026, and yes the page header saidnfsd4_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
- 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