From patchwork Sun Jun 19 21:58:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 895512 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5JLwSXx004322 for ; Sun, 19 Jun 2011 21:58:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752929Ab1FSV61 (ORCPT ); Sun, 19 Jun 2011 17:58:27 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:57194 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754170Ab1FSV60 (ORCPT ); Sun, 19 Jun 2011 17:58:26 -0400 Received: by pvg12 with SMTP id 12so266604pvg.19 for ; Sun, 19 Jun 2011 14:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:cc:subject:date:message-id :x-mailer; bh=uhwL8AuNT3uUjIv2j0nSmgeq+SBhDU+i0JpwnET9VPM=; b=U7uAHBXKvYfhr0bO5uxbHncVtfR9rntUf/2q2UkflmCUfdeJxLZ6a61YbrAqFwWAdf iLKqlrNj+sb5wvoNf+cOIB6IHdYzVjHmHwht1W9qIUwVwn3oi5NtgOS9u/d+k4etTYZI e5odYtbH/Gt+ntc8vgp/a/uuwuRuIAJwt/6iM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; b=vYMBZMcJ3H7xnC3LFkXCK+lWDE1OvYoH/07nldWfD6KGfqDFv4is3sz5rOiBFECo/8 SfXfvA/+7mujrnpeS7CYrM6ba0o4/Gy9hpGY+laUKtSdXnaXsmJtZ//ArH7bV4IQ+8Rv EHWM5teRrGTQzQAbXHL69xgr8/nsmd3sBQ3dE= Received: by 10.68.68.242 with SMTP id z18mr348148pbt.455.1308520706007; Sun, 19 Jun 2011 14:58:26 -0700 (PDT) Received: from localhost.localdomain (209-45-135-130.dia.static.qwest.net [209.45.135.130]) by mx.google.com with ESMTPS id z7sm1733584pbk.67.2011.06.19.14.58.23 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Jun 2011 14:58:25 -0700 (PDT) From: Benny Halevy To: Trond Myklebust Cc: linux-nfs@vger.kernel.org Subject: [PATCH] NFSv4.1: file layout must consider pg_bsize for coalescing Date: Sun, 19 Jun 2011 17:58:13 -0400 Message-Id: <1308520693-31114-1-git-send-email-benny@tonian.com> X-Mailer: git-send-email 1.7.4.4 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 19 Jun 2011 21:58:28 +0000 (UTC) Otherwise we end up overflowing the rpc buffer size on the receive end. This bug was introduced in v3.0. Signed-off-by: Benny Halevy --- fs/nfs/nfs4filelayout.c | 4 +++- fs/nfs/pagelist.c | 1 + 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c index 472f81f..51c1909 100644 --- a/fs/nfs/nfs4filelayout.c +++ b/fs/nfs/nfs4filelayout.c @@ -30,6 +30,7 @@ */ #include +#include #include "internal.h" #include "nfs4filelayout.h" @@ -672,7 +673,8 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, u64 p_stripe, r_stripe; u32 stripe_unit; - if (!pnfs_generic_pg_test(pgio, prev, req)) + if (!pnfs_generic_pg_test(pgio, prev, req) || + !nfs_generic_pg_test(pgio, prev, req)) return false; p_stripe = (u64)prev->wb_index << PAGE_CACHE_SHIFT; diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index a46d827..d421e19 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -218,6 +218,7 @@ bool nfs_generic_pg_test(struct nfs_pageio_descriptor *desc, struct nfs_page *pr return desc->pg_count + req->wb_bytes <= desc->pg_bsize; } +EXPORT_SYMBOL_GPL(nfs_generic_pg_test); /** * nfs_pageio_init - initialise a page io descriptor