]> git.hungrycats.org Git - linux/commitdiff
[PATCH] kNFSd: ensure XDR buffer is large enough for NFSv4
authorNeil Brown <neilb@cse.unsw.edu.au>
Fri, 11 Oct 2002 12:34:33 +0000 (05:34 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Fri, 11 Oct 2002 12:34:33 +0000 (05:34 -0700)
This patch changes the 'xdrsize' parameter to svc_create(), to be
     NFS4_SVC_XDRSIZE   if v4 is defined
else NFS3_SVC_XDRSIZE   if v3 is defined
else NFS2_SVC_XDRSIZE     (formerly NFSSVC_XDRSIZE)

This always works, since
     NFS4_SVC_XDRSIZE >= NFS3_SVC_XDRSIZE >= NFS2_SVC_XDRSIZE.

The value of NFSD_BUFSIZE has also been moved to const.h, since we need
the definition available in nfs4proc.c

fs/nfsd/nfssvc.c
include/linux/nfsd/const.h
include/linux/nfsd/xdr.h

index 243bc5bbf4146a4b7fbea4a8bb87436d041b221c..b7010af8eae5d32f94f5b5e53f4396a429f632e2 100644 (file)
 #include <linux/nfsd/stats.h>
 #include <linux/nfsd/cache.h>
 #include <linux/nfsd/xdr.h>
+#include <linux/nfsd/xdr3.h>
+#include <linux/nfsd/xdr4.h>
 #include <linux/lockd/bind.h>
 
 #define NFSDDBG_FACILITY       NFSDDBG_SVC
-#define NFSD_BUFSIZE           (1024 + NFSSVC_MAXBLKSIZE)
 
 /* these signals will be delivered to an nfsd thread 
  * when handling a request
index 623d577ca1b547dc59948fccf539482d98e5d2c5..b75bb1b38d09a244dcb46f569828424105dc3834 100644 (file)
 # define NFS_SUPER_MAGIC       0x6969
 #endif
 
+#define NFSD_BUFSIZE           (1024 + NFSSVC_MAXBLKSIZE)
+
+#ifdef CONFIG_NFSD_V4
+# define NFSSVC_XDRSIZE                NFS4_SVC_XDRSIZE
+#elif defined(CONFIG_NFSD_V3)
+# define NFSSVC_XDRSIZE                NFS3_SVC_XDRSIZE
+#else
+# define NFSSVC_XDRSIZE                NFS2_SVC_XDRSIZE
+#endif
+
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_NFSD_CONST_H */
index 5d96579529ed7419483261ebd1eec9b5a669b5eb..d81b71fefe6d36d82d8084a9464122a7747522b4 100644 (file)
@@ -119,7 +119,7 @@ union nfsd_xdrstore {
        struct nfsd_readdirargs readdir;
 };
 
-#define NFSSVC_XDRSIZE         sizeof(union nfsd_xdrstore)
+#define NFS2_SVC_XDRSIZE       sizeof(union nfsd_xdrstore)
 
 
 int nfssvc_decode_void(struct svc_rqst *, u32 *, void *);