All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benny Halevy <benny@tonian.com>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
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	[thread overview]
Message-ID: <1308520693-31114-1-git-send-email-benny@tonian.com> (raw)

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 <benny@tonian.com>
---
 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 <linux/nfs_fs.h>
+#include <linux/nfs_page.h>
 
 #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
-- 
1.7.4.4


             reply	other threads:[~2011-06-19 21:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-19 21:58 Benny Halevy [this message]
2011-06-19 22:33 ` [PATCH v2] NFSv4.1: file layout must consider pg_bsize for coalescing Benny Halevy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1308520693-31114-1-git-send-email-benny@tonian.com \
    --to=benny@tonian.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.