From 213484254c65e3c39c59df454132748b1367f816 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Wed, 22 Jun 2005 17:16:28 +0000 Subject: [PATCH] fix nfsacl pointer arithmetic and pg_class initialization bugs * Pointer arithmetic bug: p is in word units. This fixes a memory corruption with big acls. * Initialize pg_class to prevent a NULL pointer access. Signed-off-by: Andreas Gruenbacher Signed-off-by: Trond Myklebust --- fs/nfs/nfs3xdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/nfs/nfs3xdr.c') diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index a4437fb177f..db4a904810a 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c @@ -677,7 +677,7 @@ nfs3_xdr_setaclargs(struct rpc_rqst *req, u32 *p, /* put as much of the acls into head as possible. */ len_in_head = min_t(unsigned int, buf->head->iov_len - base, len); len -= len_in_head; - req->rq_slen = xdr_adjust_iovec(req->rq_svec, p + len_in_head); + req->rq_slen = xdr_adjust_iovec(req->rq_svec, p + (len_in_head >> 2)); for (count = 0; (count << PAGE_SHIFT) < len; count++) { args->pages[count] = alloc_page(GFP_KERNEL); -- cgit v1.2.3