diff mbox

[2/4] nfs: use NFS4_MAXTAGLEN for cb_taglen checking

Message ID 5516CD98.70706@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kinglong Mee March 28, 2015, 3:49 p.m. UTC
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/nfs/callback_xdr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index 1737c2e..ea6d4de 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -18,8 +18,7 @@ 
 #include "internal.h"
 #include "nfs4session.h"
 
-#define CB_OP_TAGLEN_MAXSZ	(512)
-#define CB_OP_HDR_RES_MAXSZ	(2 + CB_OP_TAGLEN_MAXSZ)
+#define CB_OP_HDR_RES_MAXSZ	(2 + NFS4_MAXTAGLEN)
 #define CB_OP_GETATTR_BITMAP_MAXSZ	(4)
 #define CB_OP_GETATTR_RES_MAXSZ	(CB_OP_HDR_RES_MAXSZ + \
 				CB_OP_GETATTR_BITMAP_MAXSZ + \
@@ -157,7 +156,7 @@  static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound
 	if (unlikely(status != 0))
 		return status;
 	/* We do not like overly long tags! */
-	if (hdr->taglen > CB_OP_TAGLEN_MAXSZ) {
+	if (hdr->taglen > NFS4_MAXTAGLEN) {
 		printk("NFS: NFSv4 CALLBACK %s: server sents tag of length %u\n",
 				__func__, hdr->taglen);
 		return htonl(NFS4ERR_RESOURCE);