linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] NFS: Remove bad delegations during open recovery
@ 2012-09-26 17:12 bjschuma
  2012-09-26 17:12 ` [PATCH 2/2] NFS: Always use the open stateid when checking for expired opens bjschuma
  2012-09-26 19:07 ` [PATCH 1/2] NFS: Remove bad delegations during open recovery Myklebust, Trond
  0 siblings, 2 replies; 3+ messages in thread
From: bjschuma @ 2012-09-26 17:12 UTC (permalink / raw)
  To: Trond.Myklebust; +Cc: linux-nfs

From: Bryan Schumaker <bjschuma@netapp.com>

I put the client into an open recovery loop by:
	Client: Open file
		read half
	Server: Expire client (echo 0 > /sys/kernel/debug/nfsd/forget_clients)
	Client: Drop vm cache (echo 3 > /proc/sys/vm/drop_caches)
		finish reading file

This causes a loop because the client never updates the nfs4_state after
discovering that the delegation is invalid.  This means it will keep
trying to read using the bad delegation rather than attempting to re-open
the file.

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
---
 fs/nfs/nfs4proc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 1e50326..e47ec55 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1774,7 +1774,9 @@ static void nfs41_clear_delegation_stateid(struct nfs4_state *state)
 		 * informs us the stateid is unrecognized. */
 		if (status != -NFS4ERR_BAD_STATEID)
 			nfs41_free_stateid(server, stateid);
+		nfs_remove_bad_delegation(state->inode);
 
+		nfs4_stateid_copy(&state->stateid, &state->open_stateid);
 		clear_bit(NFS_DELEGATED_STATE, &state->flags);
 	}
 }
-- 
1.7.12.1


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

* [PATCH 2/2] NFS: Always use the open stateid when checking for expired opens
  2012-09-26 17:12 [PATCH 1/2] NFS: Remove bad delegations during open recovery bjschuma
@ 2012-09-26 17:12 ` bjschuma
  2012-09-26 19:07 ` [PATCH 1/2] NFS: Remove bad delegations during open recovery Myklebust, Trond
  1 sibling, 0 replies; 3+ messages in thread
From: bjschuma @ 2012-09-26 17:12 UTC (permalink / raw)
  To: Trond.Myklebust; +Cc: linux-nfs

From: Bryan Schumaker <bjschuma@netapp.com>

If we are reading through a delegation, and the delegation is OK then
state->stateid will still point to a delegation stateid and not an open
stateid.

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
---
 fs/nfs/nfs4proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index e47ec55..df7e1a3 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1792,7 +1792,7 @@ static void nfs41_clear_delegation_stateid(struct nfs4_state *state)
 static int nfs41_check_open_stateid(struct nfs4_state *state)
 {
 	struct nfs_server *server = NFS_SERVER(state->inode);
-	nfs4_stateid *stateid = &state->stateid;
+	nfs4_stateid *stateid = &state->open_stateid;
 	int status;
 
 	/* If a state reset has been done, test_stateid is unneeded */
-- 
1.7.12.1


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

* Re: [PATCH 1/2] NFS: Remove bad delegations during open recovery
  2012-09-26 17:12 [PATCH 1/2] NFS: Remove bad delegations during open recovery bjschuma
  2012-09-26 17:12 ` [PATCH 2/2] NFS: Always use the open stateid when checking for expired opens bjschuma
@ 2012-09-26 19:07 ` Myklebust, Trond
  1 sibling, 0 replies; 3+ messages in thread
From: Myklebust, Trond @ 2012-09-26 19:07 UTC (permalink / raw)
  To: Schumaker, Bryan; +Cc: linux-nfs@vger.kernel.org

T24gV2VkLCAyMDEyLTA5LTI2IGF0IDEzOjEyIC0wNDAwLCBianNjaHVtYUBuZXRhcHAuY29tIHdy
b3RlOg0KPiBGcm9tOiBCcnlhbiBTY2h1bWFrZXIgPGJqc2NodW1hQG5ldGFwcC5jb20+DQo+IA0K
PiBJIHB1dCB0aGUgY2xpZW50IGludG8gYW4gb3BlbiByZWNvdmVyeSBsb29wIGJ5Og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GVnYXRpb25fc3RhdGVpZChzdHJ1Y3QgbmZzNF9zdGF0ZSAq
c3RhdGUpDQo+ICAJCSAqIGluZm9ybXMgdXMgdGhlIHN0YXRlaWQgaXMgdW5yZWNvZ25pemVkLiAq
Lw0KPiAgCQlpZiAoc3RhdHVzICE9IC1ORlM0RVJSX0JBRF9TVEFURUlEKQ0KPiAgCQkJbmZzNDFf
ZnJlZV9zdGF0ZWlkKHNlcnZlciwgc3RhdGVpZCk7DQo+ICsJCW5mc19yZW1vdmVfYmFkX2RlbGVn
YXRpb24oc3RhdGUtPmlub2RlKTsNCj4gIA0KPiArCQluZnM0X3N0YXRlaWRfY29weSgmc3RhdGUt
PnN0YXRlaWQsICZzdGF0ZS0+b3Blbl9zdGF0ZWlkKTsNCg0KbmZzNF9zdGF0ZWlkX2NvcHkgbmVl
ZHMgdG8gYmUgd3JpdGUtcHJvdGVjdGVkIGJ5IHRoZSBzdGF0ZS0+c2VxbG9jaw0KaGVyZS4NCg0K
PiAgCQljbGVhcl9iaXQoTkZTX0RFTEVHQVRFRF9TVEFURSwgJnN0YXRlLT5mbGFncyk7DQo+ICAJ
fQ0KPiAgfQ0KDQotLSANClRyb25kIE15a2xlYnVzdA0KTGludXggTkZTIGNsaWVudCBtYWludGFp
bmVyDQoNCk5ldEFwcA0KVHJvbmQuTXlrbGVidXN0QG5ldGFwcC5jb20NCnd3dy5uZXRhcHAuY29t
DQo=

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-26 17:12 [PATCH 1/2] NFS: Remove bad delegations during open recovery bjschuma
2012-09-26 17:12 ` [PATCH 2/2] NFS: Always use the open stateid when checking for expired opens bjschuma
2012-09-26 19:07 ` [PATCH 1/2] NFS: Remove bad delegations during open recovery Myklebust, Trond

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).