]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
NFSv4: Ensure we throw out bad delegation stateids on NFS4ERR_BAD_STATEID
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 9 Feb 2012 20:31:36 +0000 (15:31 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Mar 2012 00:33:42 +0000 (16:33 -0800)
commit b9f9a03150969e4bd9967c20bce67c4de769058f upstream.

To ensure that we don't just reuse the bad delegation when we attempt to
recover the nfs4_state that received the bad stateid error.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4state.c

index 87822a32709c71f6910a5dc9033f54d6232ce552..9e7e9a524167530d7a0ad80e573875180ba7f7cd 100644 (file)
@@ -1065,6 +1065,8 @@ void nfs4_schedule_stateid_recovery(const struct nfs_server *server, struct nfs4
 {
        struct nfs_client *clp = server->nfs_client;
 
+       if (test_and_clear_bit(NFS_DELEGATED_STATE, &state->flags))
+               nfs_async_inode_return_delegation(state->inode, &state->stateid);
        nfs4_state_mark_reclaim_nograce(clp, state);
        nfs4_schedule_state_manager(clp);
 }