Re: RPCSVC_MAXPAGES doesn't account for overhead(?) pages

Zwane Mwaikambo (zwane@holomorphy.com)
Sat, 22 Mar 2003 11:52:44 -0500 (EST)


On Sat, 22 Mar 2003, Zwane Mwaikambo wrote:

> I got this BUG with a 32k PAGE_SIZE, it looks like we unconditionally
> allocate 2 extra pages on top of requested size so we wouldn't be able to
> service a maximum payload from nfsd.
>
> Is there a more suitable/elegant fix?

I forgot the patch...

Index: linux-2.5.65-pgcl/include/linux/sunrpc/svc.h
===================================================================
RCS file: /build/cvsroot/linux-2.5.65/include/linux/sunrpc/svc.h,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 svc.h
--- linux-2.5.65-pgcl/include/linux/sunrpc/svc.h 17 Mar 2003 23:08:31 -0000 1.1.1.1
+++ linux-2.5.65-pgcl/include/linux/sunrpc/svc.h 22 Mar 2003 16:22:22 -0000
@@ -73,7 +73,8 @@ struct svc_serv {
* This assumes that the non-page part of an rpc reply will fit
* in a page - NFSd ensures this. lockd also has no trouble.
*/
-#define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 1)
+
+#define RPCSVC_MAXPAGES (2+((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE+1))

static inline u32 svc_getu32(struct iovec *iov)
{

-- 
function.linuxpower.ca
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/