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)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 12 Nov 2014 22:19:04 +0000 (17:19 -0500)
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
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/delegation.c

index e5f473d13e249b6804daa6a7c7e3d423df80c8e2..7f3f60641344437ab4f493eebf6093e39957c3be 100644 (file)
@@ -125,6 +125,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);