From: Peng Tao Date: Fri, 11 Sep 2015 03:14:06 +0000 (+0800) Subject: nfs: fix pg_test page count calculation X-Git-Tag: v4.1.11~106 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0fe83960ecd61b82fb436728712330b61b47d53a;p=users%2Fjedix%2Flinux-maple.git nfs: fix pg_test page count calculation commit 048883e0b934d9a5103d40e209cb14b7f33d2933 upstream. We really want sizeof(struct page *) instead. Otherwise we limit maximum IO size to 64 pages rather than 512 pages on a 64bit system. Fixes 2e11f829(nfs: cap request size to fit a kmalloced page array). Cc: Christoph Hellwig Signed-off-by: Peng Tao Fixes: 2e11f8296d22 ("nfs: cap request size to fit a kmalloced page array") Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 069914ce7641..93d355c8b467 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -508,7 +508,7 @@ size_t nfs_generic_pg_test(struct nfs_pageio_descriptor *desc, * for it without upsetting the slab allocator. */ if (((mirror->pg_count + req->wb_bytes) >> PAGE_SHIFT) * - sizeof(struct page) > PAGE_SIZE) + sizeof(struct page *) > PAGE_SIZE) return 0; return min(mirror->pg_bsize - mirror->pg_count, (size_t)req->wb_bytes);