summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorChuck Lever <cel@kernel.org>2026-09-16 12:28:57 -0400
committerChuck Lever <cel@kernel.org>2026-10-11 23:13:01 -0400
commit7f99da631a4e981860907de2a90bb0978abbcfa4 (patch)
tree64be6c0f50fc1933bead4727951f7160c25fc547 /tools/lib/python
parent58e8a4dadb92cb6e393ace5a3dcec89b08136af9 (diff)
downloadlinux-next-7f99da631a4e981860907de2a90bb0978abbcfa4.tar.gz
linux-next-7f99da631a4e981860907de2a90bb0978abbcfa4.zip
NFSD: Refactor NFSv2 directory cookie encoding
The current synopsis of nfssvc_encode_nfscookie() takes a "struct nfsd_readdirres" argument, which is used by the NFSv2 READDIR procedure. xdrgen defines a distinct argument structure for this procedure. With a "struct READDIRargs," the nfscookie encoder will need generic parameter types in order to be usable. Note that NFSD can't use the xdrgen-generated nfscookie encoder. This is because directory cookies need to point to the previous directory entry. Space for each cookie in the send buffer is reserved when each directory entry is encoded; when the /next/ entry is encoded, the encoder writes its offset into that reserved space. As a clean-up, remove "resp->cookie_offset = 0;" : - In nfssvc_encode_entry(), immediately after calling nfssvc_encode_nfscookie(), the code calls svcxdr_encode_entry_common() which sets a new value for resp->cookie_offset. The cookie_offset value was immediately overwritten. - In nfsd_proc_readdir(), nfssvc_encode_nfscookie() is called as the last cookie encoding, and no further use of cookie_offset follows. - The out_toosmall error path in nfssvc_encode_entry() continues to set resp->cookie_offset = 0 Acked-by: Jeff Layton <jlayton@kernel.org> Link: https://patch.msgid.link/20260916162859.2051-29-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions