NFSD's new READDIRPLUS dirent encoder blows past the end of the directory payload xdr_stream when the client requests more than a page worth of directory entries. I tracked this down to how xdr_get_next_encode_buffer() computes xdr->end. First patch in this series is the fix. The remaining patches are clean-ups and optimizations. I want to get this series into 5.19-rc quickly. I would appreciate getting one more R-b for this series, preferrably from one of the NFS client maintainers. Changes since v1: - Adjusted patch 2/5 per Neil Brown's suggestion - Series applied to my NFS client and tested there --- Chuck Lever (5): SUNRPC: Fix the calculation of xdr->end in xdr_get_next_encode_buffer() SUNRPC: Optimize xdr_reserve_space() SUNRPC: Clean up xdr_commit_encode() SUNRPC: Clean up xdr_get_next_encode_buffer() SUNRPC: Remove pointer type casts from xdr_get_next_encode_buffer() include/linux/sunrpc/xdr.h | 16 +++++++++++++++- net/sunrpc/xdr.c | 37 +++++++++++++++++++++++-------------- 2 files changed, 38 insertions(+), 15 deletions(-) -- Chuck Lever