nfsd: lock state around put client and delegation in nfsd4_cb_recall
authorAlexandros Batsakis <batsakis@netapp.com>
Fri, 19 Dec 2008 03:55:16 +0000 (19:55 -0800)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Wed, 18 Mar 2009 21:30:50 +0000 (17:30 -0400)
not having the state locked before putting the client/delegation causes a bug.
Also removed the comment from the function header about the state being already locked

Signed-off-by: Alexandros Batsakis <batsakis@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/nfs4callback.c

index c6804db..3ddc9fb 100644 (file)
@@ -451,7 +451,6 @@ nfsd4_probe_callback(struct nfs4_client *clp)
 
 /*
  * called with dp->dl_count inc'ed.
- * nfs4_lock_state() may or may not have been called.
  */
 void
 nfsd4_cb_recall(struct nfs4_delegation *dp)
@@ -491,7 +490,9 @@ out_put_cred:
         * Success or failure, now we're either waiting for lease expiration
         * or deleg_return.
         */
+       nfs4_lock_state();
        put_nfs4_client(clp);
        nfs4_put_delegation(dp);
+       nfs4_unlock_state();
        return;
 }