All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] NFS4: remove erroneous BUG_ONs in file layout pg_init functions
@ 2012-03-13 19:19 Fred Isaman
  2012-03-13 19:26 ` Myklebust, Trond
  0 siblings, 1 reply; 2+ messages in thread
From: Fred Isaman @ 2012-03-13 19:19 UTC (permalink / raw)
  To: linux-nfs; +Cc: Trond Myklebust

These BUG_ONs assume that pg_init is called once per nfs_pageio_descriptor,
yet it is actually called once per attempted RPC call.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
 fs/nfs/nfs4filelayout.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index c7496b6..3c2ee2f 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -757,7 +757,7 @@ void
 filelayout_pg_init_read(struct nfs_pageio_descriptor *pgio,
 			struct nfs_page *req)
 {
-	BUG_ON(pgio->pg_lseg != NULL);
+	struct pnfs_layout_segment *old = pgio->pg_lseg;
 
 	pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode,
 					   req->wb_context,
@@ -765,6 +765,7 @@ filelayout_pg_init_read(struct nfs_pageio_descriptor *pgio,
 					   NFS4_MAX_UINT64,
 					   IOMODE_READ,
 					   GFP_KERNEL);
+	put_lseg(old);
 	/* If no lseg, fall back to read through mds */
 	if (pgio->pg_lseg == NULL)
 		nfs_pageio_reset_read_mds(pgio);
@@ -774,7 +775,7 @@ void
 filelayout_pg_init_write(struct nfs_pageio_descriptor *pgio,
 			 struct nfs_page *req)
 {
-	BUG_ON(pgio->pg_lseg != NULL);
+	struct pnfs_layout_segment *old = pgio->pg_lseg;
 
 	pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode,
 					   req->wb_context,
@@ -782,6 +783,7 @@ filelayout_pg_init_write(struct nfs_pageio_descriptor *pgio,
 					   NFS4_MAX_UINT64,
 					   IOMODE_RW,
 					   GFP_NOFS);
+	put_lseg(old);
 	/* If no lseg, fall back to write through mds */
 	if (pgio->pg_lseg == NULL)
 		nfs_pageio_reset_write_mds(pgio);
-- 
1.7.2.1


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

* Re: [PATCH 1/1] NFS4: remove erroneous BUG_ONs in file layout pg_init functions
  2012-03-13 19:19 [PATCH 1/1] NFS4: remove erroneous BUG_ONs in file layout pg_init functions Fred Isaman
@ 2012-03-13 19:26 ` Myklebust, Trond
  0 siblings, 0 replies; 2+ messages in thread
From: Myklebust, Trond @ 2012-03-13 19:26 UTC (permalink / raw)
  To: Isaman, Fred; +Cc: linux-nfs

T24gVHVlLCAyMDEyLTAzLTEzIGF0IDE1OjE5IC0wNDAwLCBGcmVkIElzYW1hbiB3cm90ZToNCj4g
VGhlc2UgQlVHX09OcyBhc3N1bWUgdGhhdCBwZ19pbml0IGlzIGNhbGxlZCBvbmNlIHBlciBuZnNf
cGFnZWlvX2Rlc2NyaXB0b3IsDQo+IHlldCBpdCBpcyBhY3R1YWxseSBjYWxsZWQgb25jZSBwZXIg
YXR0ZW1wdGVkIFJQQyBjYWxsLg0KDQpTaG91bGRuJ3QgdGhlIHBnX2xzZWcgX2Fsd2F5c18gZ2V0
IGNsZWFyZWQgb3V0IGluIHRoZSBwZ19kb2lvIGNhbGxiYWNrPw0KSWYgbm90LCB3ZSByaXNrIGxl
YWtpbmcgbHNlZ3MuDQpJT1c6IEFzIGZhciBhcyBJIGNhbiB0ZWxsLCB0aG9zZSBCVUdfT05zIGFy
ZSBjb3JyZWN0Lg0KDQotLSANClRyb25kIE15a2xlYnVzdA0KTGludXggTkZTIGNsaWVudCBtYWlu
dGFpbmVyDQoNCk5ldEFwcA0KVHJvbmQuTXlrbGVidXN0QG5ldGFwcC5jb20NCnd3dy5uZXRhcHAu
Y29tDQoNCg==

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

end of thread, other threads:[~2012-03-13 19:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-13 19:19 [PATCH 1/1] NFS4: remove erroneous BUG_ONs in file layout pg_init functions Fred Isaman
2012-03-13 19:26 ` 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.