NFS: Don't try to reclaim delegation open state if recovery failed
authorTrond Myklebust <trond.myklebust@primarydata.com>
Fri, 17 Oct 2014 20:02:52 +0000 (23:02 +0300)
committerJiri Slaby <jslaby@suse.cz>
Wed, 19 Nov 2014 17:38:23 +0000 (18:38 +0100)
commit f8ebf7a8ca35dde321f0cd385fee6f1950609367 upstream.

If state recovery failed, then we should not attempt to reclaim delegated
state.

http://lkml.kernel.org/r/CAN-5tyHwG=Cn2Q9KsHWadewjpTTy_K26ee+UnSvHvG4192p-Xw@mail.gmail.com
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/nfs/delegation.c

index 5d8ccecf5f5caada2de94bf30689ecd9e725a15a..6acc11e6ebad4259af0946930399c5477c78ef3c 100644 (file)
@@ -109,6 +109,8 @@ static int nfs_delegation_claim_opens(struct inode *inode, const nfs4_stateid *s
                        continue;
                if (!test_bit(NFS_DELEGATED_STATE, &state->flags))
                        continue;
+               if (!nfs4_valid_open_stateid(state))
+                       continue;
                if (!nfs4_stateid_match(&state->stateid, stateid))
                        continue;
                get_nfs_open_context(ctx);