All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NFS: filelayout should use nfs_generic_pg_test
@ 2011-06-01  3:18 Weston Andros Adamson
  2011-06-01  5:47 ` Boaz Harrosh
  0 siblings, 1 reply; 23+ messages in thread
From: Weston Andros Adamson @ 2011-06-01  3:18 UTC (permalink / raw)
  To: trond; +Cc: linux-nfs, Weston Andros Adamson

Use nfs_generic_pg_test instead of pnfs_generic_pg_test.

This fixes the BUG at fs/nfs/write.c:941 introduced by
89a58e32d9105c01022a757fb32ddc3b51bf0025.

I was able to trigger this BUG reliably using pynfs in pnfs mode,
by using dd(1) to write many small blocks.

Signed-off-by: Weston Andros Adamson <dros@netapp.com>
---
Fix proposed by Trond.

Benny- Does this make sense?

 fs/nfs/nfs4filelayout.c  |    2 +-
 fs/nfs/pagelist.c        |    5 ++++-
 include/linux/nfs_page.h |    3 ++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 4269088..1c3bb72 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -661,7 +661,7 @@ 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 (!nfs_generic_pg_test(pgio, prev, req))
 		return 0;
 
 	if (!pgio->pg_lseg)
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 7913961..1a4b0de 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -204,7 +204,9 @@ nfs_wait_on_request(struct nfs_page *req)
 			TASK_UNINTERRUPTIBLE);
 }
 
-static bool nfs_generic_pg_test(struct nfs_pageio_descriptor *desc, struct nfs_page *prev, struct nfs_page *req)
+bool
+nfs_generic_pg_test(struct nfs_pageio_descriptor *desc, struct nfs_page *prev,
+		    struct nfs_page *req)
 {
 	/*
 	 * FIXME: ideally we should be able to coalesce all requests
@@ -218,6 +220,7 @@ static bool nfs_generic_pg_test(struct nfs_pageio_descriptor *desc, struct nfs_p
 
 	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
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 3a34e80..7d8a779 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -96,7 +96,8 @@ extern  int nfs_wait_on_request(struct nfs_page *);
 extern	void nfs_unlock_request(struct nfs_page *req);
 extern	int nfs_set_page_tag_locked(struct nfs_page *req);
 extern  void nfs_clear_page_tag_locked(struct nfs_page *req);
-
+extern  bool nfs_generic_pg_test(struct nfs_pageio_descriptor *desc,
+				 struct nfs_page *prev, struct nfs_page *req);
 
 /*
  * Lock the page of an asynchronous request without getting a new reference
-- 
1.7.5.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2011-06-06 18:23 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-01  3:18 [PATCH] NFS: filelayout should use nfs_generic_pg_test Weston Andros Adamson
2011-06-01  5:47 ` Boaz Harrosh
2011-06-01 12:14   ` Trond Myklebust
2011-06-01 13:36     ` Boaz Harrosh
2011-06-01 13:43       ` Benny Halevy
2011-06-01 14:32         ` Benny Halevy
2011-06-01 14:44   ` Weston Andros Adamson
2011-06-01 14:51     ` Benny Halevy
2011-06-01 15:36       ` Weston Andros Adamson
2011-06-01 16:01       ` Fred Isaman
2011-06-01 18:56         ` Benny Halevy
2011-06-01 19:17           ` Trond Myklebust
2011-06-01 19:29             ` Boaz Harrosh
2011-06-01 19:38               ` Trond Myklebust
2011-06-01 19:49                 ` Boaz Harrosh
2011-06-01 19:52                   ` Trond Myklebust
2011-06-01 18:07       ` Trond Myklebust
2011-06-01 19:13         ` Benny Halevy
2011-06-01 19:29           ` Trond Myklebust
2011-06-01 20:09             ` Benny Halevy
2011-06-06 16:47               ` William A. (Andy) Adamson
2011-06-06 18:21                 ` Benny Halevy
2011-06-06 18:22                   ` Myklebust, Trond

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.