[PATCH 2/2] SQUASHME: pnfs-submit: fix getdevicelist decode sizing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



it looks like we forgot to adjust hdr->replen in
encode_getdevicelist.

spell out the fields for decode_getdevicelist_maxsz.

Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx>
---
 fs/nfs/nfs4xdr.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index c422964..398951e 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -318,10 +318,15 @@ static int nfs4_stat_to_errno(int);
 #define decode_reclaim_complete_maxsz	(op_decode_hdr_maxsz + 4)
 #define encode_getdevicelist_maxsz (op_encode_hdr_maxsz + 4 + \
 				encode_verifier_maxsz)
-#define decode_getdevicelist_maxsz (op_decode_hdr_maxsz + 2 + 1 + 1 +  \
-				decode_verifier_maxsz +             \
-				XDR_QUADLEN(NFS4_PNFS_GETDEVLIST_MAXNUM *  \
-				NFS4_PNFS_DEVICEID4_SIZE))
+#define decode_getdevicelist_maxsz (op_decode_hdr_maxsz + \
+				2 /* nfs_cookie4 gdlr_cookie */ + \
+				decode_verifier_maxsz \
+				  /* verifier4 gdlr_verifier */ + \
+				1 /* gdlr_deviceid_list count */ + \
+				XDR_QUADLEN(NFS4_PNFS_GETDEVLIST_MAXNUM * \
+					    NFS4_PNFS_DEVICEID4_SIZE) \
+				  /* gdlr_deviceid_list */ + \
+				1 /* bool gdlr_eof */)
 #define encode_getdeviceinfo_maxsz (op_encode_hdr_maxsz + 4 + \
 				XDR_QUADLEN(NFS4_PNFS_DEVICEID4_SIZE))
 #define decode_getdeviceinfo_maxsz (op_decode_hdr_maxsz + \
@@ -1868,6 +1873,7 @@ encode_getdevicelist(struct xdr_stream *xdr,
 	xdr_encode_hyper(p, 0ULL);                          /* cookie */
 	encode_nfs4_verifier(xdr, &dummy);
 	hdr->nops++;
+	hdr->replen += decode_getdevicelist_maxsz;
 }
 
 static void
-- 
1.7.2.2

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux