Revert "nfsd: remove_stid can be incorporated into nfs4_put_delegation"
authorJ. Bruce Fields <bfields@redhat.com>
Mon, 4 Nov 2013 22:46:04 +0000 (17:46 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 4 Nov 2013 22:46:50 +0000 (17:46 -0500)
This reverts commit 7ebe40f20372688a627ad6c754bc0d1c05df58a9.  We forgot
the nfs4_put_delegation call in fs/nfsd/nfs4callback.c which should not
be unhashing the stateid.  This lead to warnings from the idr code when
we tried to removed id's twice.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c

index e03e8efff53f8877284625ce274d486bd690f02a..0cceb99705c923d5ee1fc3355a4d996d4171efa4 100644 (file)
@@ -410,7 +410,6 @@ static void nfs4_free_stid(struct kmem_cache *slab, struct nfs4_stid *s)
 void
 nfs4_put_delegation(struct nfs4_delegation *dp)
 {
-       remove_stid(&dp->dl_stid);
        if (atomic_dec_and_test(&dp->dl_count)) {
                nfs4_free_stid(deleg_slab, &dp->dl_stid);
                num_delegations--;
@@ -451,12 +450,14 @@ unhash_delegation(struct nfs4_delegation *dp)
 static void destroy_revoked_delegation(struct nfs4_delegation *dp)
 {
        list_del_init(&dp->dl_recall_lru);
+       remove_stid(&dp->dl_stid);
        nfs4_put_delegation(dp);
 }
 
 static void destroy_delegation(struct nfs4_delegation *dp)
 {
        unhash_delegation(dp);
+       remove_stid(&dp->dl_stid);
        nfs4_put_delegation(dp);
 }
 
@@ -3161,6 +3162,7 @@ nfs4_open_delegation(struct net *net, struct svc_fh *fh,
        open->op_delegate_type = NFS4_OPEN_DELEGATE_READ;
        return;
 out_free:
+       remove_stid(&dp->dl_stid);
        nfs4_put_delegation(dp);
 out_no_deleg:
        open->op_delegate_type = NFS4_OPEN_DELEGATE_NONE;