REPOST patch 36/38: SERVER: ensure XDR buffer is large enough for NFSv4

REPOST patch 36/38: SERVER: ensure XDR buffer is large enough for NFSv4

Post by Kendrick M. Smit » Fri, 16 Aug 2002 06:10:05



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
--- old/fs/nfsd/nfssvc.c        Thu Aug  1 16:16:02 2002

 #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
--- old/include/linux/nfsd/const.h      Sun Aug 11 19:20:54 2002

 # 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 */
--- old/include/linux/nfsd/xdr.h        Thu Aug  1 16:16:33 2002

        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 *);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. patch 37/38: SERVER: ensure XDR buffer is large enough for NFSv4

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
--- old/include/linux/nfsd/xdr.h        Wed Jul 24 16:03:30 2002

        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 *);
--- old/include/linux/nfsd/const.h      Thu Aug  8 10:38:56 2002

 # 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 */
--- old/fs/nfsd/nfssvc.c        Wed Jul 24 16:03:18 2002

 #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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Not booting from hard drive

3. patch 36/38: SERVER: header file for NFSv4 XDR

4. ? E10K No TFTP retries after first failure

5. REPOST patch 35/38: SERVER: header file for NFSv4 XDR

6. How to get one password verification window?

7. REPOST patch 37/38: SERVER: giant patch importing NFSv4 server functionality

8. SCSI vs. EIDE

9. patch 38/38: SERVER: giant patch importing NFSv4 server functionality

10. REPOST patch 31/38: SERVER: tweak nfsd_create_v3() for NFSv4

11. REPOST patch 33/38: SERVER: tweak nfsd_readdir() for NFSv4

12. REPOST patch 02/38: NFSv4 protocol header

13. patch 32/38: SERVER: tweak nfsd_create_v3() for NFSv4