aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2014-08-09 10:22:41 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-08-17 12:00:14 -0400
commitafbda402a02bde74f350ff98243265dfd3108fb3 (patch)
treed5b1adf4fd21730c7ac49a82a43890ba3e694a37
parent6bcc034eac79873468cdfd1ccea9f25ee67c4500 (diff)
nfsd: call nfs4_put_deleg_lease outside of state_lock
Currently, we hold the state_lock when releasing the lease. That's potentially problematic in the future if we allow for setlease methods that can sleep. Move the nfs4_put_deleg_lease call out of the delegation unhashing routine (which was always a bit goofy anyway), and into the unlocked sections of the callers of unhash_delegation_locked. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/nfs4state.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 309ec3b1090a..4356d32479b2 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -722,7 +722,6 @@ unhash_delegation_locked(struct nfs4_delegation *dp)
722 list_del_init(&dp->dl_recall_lru); 722 list_del_init(&dp->dl_recall_lru);
723 list_del_init(&dp->dl_perfile); 723 list_del_init(&dp->dl_perfile);
724 spin_unlock(&fp->fi_lock); 724 spin_unlock(&fp->fi_lock);
725 nfs4_put_deleg_lease(fp);
726} 725}
727 726
728static void destroy_delegation(struct nfs4_delegation *dp) 727static void destroy_delegation(struct nfs4_delegation *dp)
@@ -730,6 +729,7 @@ static void destroy_delegation(struct nfs4_delegation *dp)
730 spin_lock(&state_lock); 729 spin_lock(&state_lock);
731 unhash_delegation_locked(dp); 730 unhash_delegation_locked(dp);
732 spin_unlock(&state_lock); 731 spin_unlock(&state_lock);
732 nfs4_put_deleg_lease(dp->dl_stid.sc_file);
733 nfs4_put_stid(&dp->dl_stid); 733 nfs4_put_stid(&dp->dl_stid);
734} 734}
735 735
@@ -739,6 +739,8 @@ static void revoke_delegation(struct nfs4_delegation *dp)
739 739
740 WARN_ON(!list_empty(&dp->dl_recall_lru)); 740 WARN_ON(!list_empty(&dp->dl_recall_lru));
741 741
742 nfs4_put_deleg_lease(dp->dl_stid.sc_file);
743
742 if (clp->cl_minorversion == 0) 744 if (clp->cl_minorversion == 0)
743 nfs4_put_stid(&dp->dl_stid); 745 nfs4_put_stid(&dp->dl_stid);
744 else { 746 else {
@@ -1639,6 +1641,7 @@ __destroy_client(struct nfs4_client *clp)
1639 while (!list_empty(&reaplist)) { 1641 while (!list_empty(&reaplist)) {
1640 dp = list_entry(reaplist.next, struct nfs4_delegation, dl_recall_lru); 1642 dp = list_entry(reaplist.next, struct nfs4_delegation, dl_recall_lru);
1641 list_del_init(&dp->dl_recall_lru); 1643 list_del_init(&dp->dl_recall_lru);
1644 nfs4_put_deleg_lease(dp->dl_stid.sc_file);
1642 nfs4_put_stid(&dp->dl_stid); 1645 nfs4_put_stid(&dp->dl_stid);
1643 } 1646 }
1644 while (!list_empty(&clp->cl_revoked)) { 1647 while (!list_empty(&clp->cl_revoked)) {
@@ -6406,6 +6409,7 @@ nfs4_state_shutdown_net(struct net *net)
6406 list_for_each_safe(pos, next, &reaplist) { 6409 list_for_each_safe(pos, next, &reaplist) {
6407 dp = list_entry (pos, struct nfs4_delegation, dl_recall_lru); 6410 dp = list_entry (pos, struct nfs4_delegation, dl_recall_lru);
6408 list_del_init(&dp->dl_recall_lru); 6411 list_del_init(&dp->dl_recall_lru);
6412 nfs4_put_deleg_lease(dp->dl_stid.sc_file);
6409 nfs4_put_stid(&dp->dl_stid); 6413 nfs4_put_stid(&dp->dl_stid);
6410 } 6414 }
6411 6415