summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Coddington <ben.coddington@hammerspace.com>2026-09-04 08:56:03 -0400
committerAnna Schumaker <anna.schumaker@hammerspace.com>2026-10-05 09:46:41 -0400
commitfcfcf04e9fb9c93b13dc51932ea995ff279c705f (patch)
tree7dcbd11de07ed256dbb260c46a8c8c8c4d766272
parent28c950413605fb5b6cb3863c5e3274ea69701097 (diff)
NFSv4.1/pnfs: derive loga_maxcount from the LAYOUTGET reply buffer
The client advertises a fixed PNFS_LAYOUT_MAXSIZE (4096) in loga_maxcount no matter what reply buffer it actually allocated. The two only happen to agree for layout drivers that cap max_layoutget_response at a single page. Block and SCSI layouts allocate a session-sized reply buffer, yet still tell the server it must not send more than 4KB of layout: a server whose extent list encodes larger than a page returns NFS4ERR_TOOSMALL even though the client has ample room to receive it. Set loga_maxcount from the size of the page array allocated for the reply. The client never advertises more than it can receive, and any future change to the reply buffer sizing automatically carries its wire advertisement with it. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Benjamin Coddington <bcodding@hammerspace.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
-rw-r--r--fs/nfs/pnfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index c5d1951d5400..9bef2997f512 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1210,7 +1210,7 @@ pnfs_alloc_init_layoutget_args(struct inode *ino,
lgp->args.minlength = i_size - range->offset;
}
}
- lgp->args.maxcount = PNFS_LAYOUT_MAXSIZE;
+ lgp->args.maxcount = lgp->args.layout.pglen;
pnfs_copy_range(&lgp->args.range, range);
lgp->args.type = server->pnfs_curr_ld->id;
lgp->args.inode = ino;