fs/nfs/nfs3xdr.c | 4 +--- fs/nfs/nfs4xdr.c | 2 +- include/linux/sunrpc/xdr.h | 2 +- net/sunrpc/auth_unix.c | 7 ++----- net/sunrpc/clnt.c | 3 --- net/sunrpc/xdr.c | 2 +- 6 files changed, 6 insertions(+), 14 deletions(-) diff -u --recursive --new-file --show-c-function linux-2.6.3-14-lockd4/fs/nfs/nfs3xdr.c linux-2.6.3-15-memset/fs/nfs/nfs3xdr.c --- linux-2.6.3-14-lockd4/fs/nfs/nfs3xdr.c 2004-02-24 14:01:26.000000000 -0800 +++ linux-2.6.3-15-memset/fs/nfs/nfs3xdr.c 2004-02-24 14:01:57.000000000 -0800 @@ -103,9 +103,7 @@ static struct { static inline u32 * xdr_encode_fhandle(u32 *p, struct nfs_fh *fh) { - *p++ = htonl(fh->size); - memcpy(p, fh->data, fh->size); - return p + XDR_QUADLEN(fh->size); + return xdr_encode_array(p, fh->data, fh->size); } static inline u32 * diff -u --recursive --new-file --show-c-function linux-2.6.3-14-lockd4/fs/nfs/nfs4xdr.c linux-2.6.3-15-memset/fs/nfs/nfs4xdr.c --- linux-2.6.3-14-lockd4/fs/nfs/nfs4xdr.c 2004-02-24 14:01:26.000000000 -0800 +++ linux-2.6.3-15-memset/fs/nfs/nfs4xdr.c 2004-02-24 14:01:57.000000000 -0800 @@ -324,7 +324,7 @@ encode_compound_hdr(struct xdr_stream *x dprintk("encode_compound: tag=%.*s\n", (int)hdr->taglen, hdr->tag); BUG_ON(hdr->taglen > NFS4_MAXTAGLEN); - RESERVE_SPACE(12+XDR_QUADLEN(hdr->taglen)); + RESERVE_SPACE(12+(XDR_QUADLEN(hdr->taglen)<<2)); WRITE32(hdr->taglen); WRITEMEM(hdr->tag, hdr->taglen); WRITE32(NFS4_MINOR_VERSION); diff -u --recursive --new-file --show-c-function linux-2.6.3-14-lockd4/include/linux/sunrpc/xdr.h linux-2.6.3-15-memset/include/linux/sunrpc/xdr.h --- linux-2.6.3-14-lockd4/include/linux/sunrpc/xdr.h 2004-02-24 13:44:01.000000000 -0800 +++ linux-2.6.3-15-memset/include/linux/sunrpc/xdr.h 2004-02-24 14:01:57.000000000 -0800 @@ -87,7 +87,7 @@ struct xdr_buf { /* * Miscellaneous XDR helper functions */ -u32 * xdr_encode_array(u32 *p, const char *s, unsigned int len); +u32 * xdr_encode_array(u32 *p, const void *s, unsigned int len); u32 * xdr_encode_string(u32 *p, const char *s); u32 * xdr_decode_string(u32 *p, char **sp, int *lenp, int maxlen); u32 * xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen); diff -u --recursive --new-file --show-c-function linux-2.6.3-14-lockd4/net/sunrpc/auth_unix.c linux-2.6.3-15-memset/net/sunrpc/auth_unix.c --- linux-2.6.3-14-lockd4/net/sunrpc/auth_unix.c 2004-02-24 13:31:54.000000000 -0800 +++ linux-2.6.3-15-memset/net/sunrpc/auth_unix.c 2004-02-25 09:09:46.000000000 -0800 @@ -149,7 +149,7 @@ unx_marshal(struct rpc_task *task, u32 * struct rpc_clnt *clnt = task->tk_client; struct unx_cred *cred = (struct unx_cred *) task->tk_msg.rpc_cred; u32 *base, *hold; - int i, n; + int i; *p++ = htonl(RPC_AUTH_UNIX); base = p++; @@ -158,10 +158,7 @@ unx_marshal(struct rpc_task *task, u32 * /* * Copy the UTS nodename captured when the client was created. */ - n = clnt->cl_nodelen; - *p++ = htonl(n); - memcpy(p, clnt->cl_nodename, n); - p += (n + 3) >> 2; + p = xdr_encode_array(p, clnt->cl_nodename, clnt->cl_nodelen); /* Note: we don't use real uid if it involves raising privilege */ if (ruid && cred->uc_puid != 0 && cred->uc_pgid != 0) { diff -u --recursive --new-file --show-c-function linux-2.6.3-14-lockd4/net/sunrpc/clnt.c linux-2.6.3-15-memset/net/sunrpc/clnt.c --- linux-2.6.3-14-lockd4/net/sunrpc/clnt.c 2004-02-24 14:01:18.000000000 -0800 +++ linux-2.6.3-15-memset/net/sunrpc/clnt.c 2004-02-24 14:01:57.000000000 -0800 @@ -611,9 +611,6 @@ call_encode(struct rpc_task *task) rcvbuf->page_len = 0; rcvbuf->len = bufsiz; - /* Zero buffer so we have automatic zero-padding of opaque & string */ - memset(task->tk_buffer, 0, bufsiz); - /* Encode header and provided arguments */ encode = task->tk_msg.rpc_proc->p_encode; if (!(p = call_header(task))) { diff -u --recursive --new-file --show-c-function linux-2.6.3-14-lockd4/net/sunrpc/xdr.c linux-2.6.3-15-memset/net/sunrpc/xdr.c --- linux-2.6.3-14-lockd4/net/sunrpc/xdr.c 2004-02-24 13:35:09.000000000 -0800 +++ linux-2.6.3-15-memset/net/sunrpc/xdr.c 2004-02-24 14:01:57.000000000 -0800 @@ -54,7 +54,7 @@ xdr_decode_netobj(u32 *p, struct xdr_net } u32 * -xdr_encode_array(u32 *p, const char *array, unsigned int len) +xdr_encode_array(u32 *p, const void *array, unsigned int len) { int quadlen = XDR_QUADLEN(len);