From patchwork Fri Sep 11 03:14:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Tao X-Patchwork-Id: 7157291 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6D52BBEEC1 for ; Fri, 11 Sep 2015 03:14:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A26B32085D for ; Fri, 11 Sep 2015 03:14:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5AECF2085A for ; Fri, 11 Sep 2015 03:14:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751130AbbIKDOq (ORCPT ); Thu, 10 Sep 2015 23:14:46 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:33676 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751013AbbIKDOp (ORCPT ); Thu, 10 Sep 2015 23:14:45 -0400 Received: by pacex6 with SMTP id ex6so61477869pac.0 for ; Thu, 10 Sep 2015 20:14:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=C8sCM/Z1CmUPwoseSx8kuX0fN5dHnGTW6HZtowqwxvQ=; b=EUQGQwB1AqgXJIEMEqj/W2SKX2sgNTO3CfAHJEp4HSYoM1tNoyNxQpDPKxme/E9GzV P4/upjoR7dWrQqq0EVljiAgvQDRAhysV7hXUWykQhbSh32+kc5jmP6j4XNrKX8KW4lzx qbI+9vaNFwwTB7gQ0P1meR78rsRdsAzR7wreeToSrTejchj+ojzWBab/+KjzQUmdb+sR O/bvq69xsEPRc5wQc8haYlO6YjjSM+CNrMCPvWPWisXWg3K+AG9LQmugHS+8B8jReWdz aEfrZ0XEiMT1kKfp9Xzkzn8oGvnZX6DROdYu+2jreyqiuvlaiC4nyyL77Wv22AeNodO9 M20g== X-Gm-Message-State: ALoCoQnwrB3du+fAK6istyzJCgcwsPseMbNIKzs4YqKls99V2dA2XdQnplpeXeHhMveas6z5vUqY X-Received: by 10.66.190.6 with SMTP id gm6mr58503625pac.27.1441941285227; Thu, 10 Sep 2015 20:14:45 -0700 (PDT) Received: from lear.localdomain (ec2-54-65-164-9.ap-northeast-1.compute.amazonaws.com. [54.65.164.9]) by smtp.gmail.com with ESMTPSA id z6sm14637265pbt.51.2015.09.10.20.14.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Sep 2015 20:14:44 -0700 (PDT) From: Peng Tao To: linux-nfs@vger.kernel.org Cc: Trond Myklebust , Peng Tao , Christoph Hellwig Subject: [PATCH] nfs: fix pg_test page count calculation Date: Fri, 11 Sep 2015 11:14:06 +0800 Message-Id: <1441941246-52981-1-git-send-email-tao.peng@primarydata.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- fs/nfs/pagelist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 7c5718b..fe3ddd2 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);