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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Nov 2014 17:22:54 +0000 (09:22 -0800)
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/delegation.c

index 4b49a8c6ccade73d7c28f6c5b30dbb05d208b820..3fa904c9e7efb31623567d195d49bb94c3014194 100644 (file)
@@ -108,6 +108,8 @@ again:
                        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);