From f1c097be2b35dcfc06c1c591194d78058dd67284 Mon Sep 17 00:00:00 2001 From: Andy Adamson Date: Tue, 25 Jun 2013 19:02:53 -0400 Subject: NFSv4.1 Fix gdia_maxcount calculation to fit in ca_maxresponsesize The GETDEVICEINFO gdia_maxcount represents all of the data being returned within the GETDEVICEINFO4resok structure and includes the XDR overhead. The CREATE_SESSION ca_maxresponsesize is the maximum reply and includes the RPC headers (including security flavor credentials and verifiers). Split out the struct pnfs_device field maxcount which is the gdia_maxcount from the pglen field which is the reply (the total) buffer length. Signed-off-by: Andy Adamson Signed-off-by: Trond Myklebust --- fs/nfs/nfs4filelayoutdev.c | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/nfs/nfs4filelayoutdev.c') diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c index 0493dbd129c5..95604f64cab8 100644 --- a/fs/nfs/nfs4filelayoutdev.c +++ b/fs/nfs/nfs4filelayoutdev.c @@ -711,6 +711,7 @@ filelayout_get_device_info(struct inode *inode, pdev->pgbase = 0; pdev->pglen = max_resp_sz; pdev->mincount = 0; + pdev->maxcount = max_resp_sz - nfs41_maxgetdevinfo_overhead; rc = nfs4_proc_getdeviceinfo(server, pdev, cred); dprintk("%s getdevice info returns %d\n", __func__, rc); -- cgit v1.2.3