aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2014-07-30 08:27:04 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-08-01 16:28:19 -0400
commit425510f5c8f1643a01668f48c43c77b8275e9227 (patch)
tree25130544db04f8bbc3172a043bd0f7556cba1f98 /fs/nfsd/nfs4state.c
parent4864af97e02d1ef6aa78963195a64ed2ed7752c3 (diff)
nfsd: Don't require client_lock in free_client
The struct nfs_client is supposed to be invisible and unreferenced before it gets here. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index a374592e7dcf..256e9032f49c 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1416,9 +1416,6 @@ static void __free_session(struct nfsd4_session *ses)
1416 1416
1417static void free_session(struct nfsd4_session *ses) 1417static void free_session(struct nfsd4_session *ses)
1418{ 1418{
1419 struct nfsd_net *nn = net_generic(ses->se_client->net, nfsd_net_id);
1420
1421 lockdep_assert_held(&nn->client_lock);
1422 nfsd4_del_conns(ses); 1419 nfsd4_del_conns(ses);
1423 nfsd4_put_drc_mem(&ses->se_fchannel); 1420 nfsd4_put_drc_mem(&ses->se_fchannel);
1424 __free_session(ses); 1421 __free_session(ses);
@@ -1568,9 +1565,6 @@ err_no_name:
1568static void 1565static void
1569free_client(struct nfs4_client *clp) 1566free_client(struct nfs4_client *clp)
1570{ 1567{
1571 struct nfsd_net __maybe_unused *nn = net_generic(clp->net, nfsd_net_id);
1572
1573 lockdep_assert_held(&nn->client_lock);
1574 while (!list_empty(&clp->cl_sessions)) { 1568 while (!list_empty(&clp->cl_sessions)) {
1575 struct nfsd4_session *ses; 1569 struct nfsd4_session *ses;
1576 ses = list_entry(clp->cl_sessions.next, struct nfsd4_session, 1570 ses = list_entry(clp->cl_sessions.next, struct nfsd4_session,
@@ -1627,7 +1621,6 @@ __destroy_client(struct nfs4_client *clp)
1627 struct nfs4_openowner *oo; 1621 struct nfs4_openowner *oo;
1628 struct nfs4_delegation *dp; 1622 struct nfs4_delegation *dp;
1629 struct list_head reaplist; 1623 struct list_head reaplist;
1630 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id);
1631 1624
1632 INIT_LIST_HEAD(&reaplist); 1625 INIT_LIST_HEAD(&reaplist);
1633 spin_lock(&state_lock); 1626 spin_lock(&state_lock);
@@ -1655,10 +1648,7 @@ __destroy_client(struct nfs4_client *clp)
1655 nfsd4_shutdown_callback(clp); 1648 nfsd4_shutdown_callback(clp);
1656 if (clp->cl_cb_conn.cb_xprt) 1649 if (clp->cl_cb_conn.cb_xprt)
1657 svc_xprt_put(clp->cl_cb_conn.cb_xprt); 1650 svc_xprt_put(clp->cl_cb_conn.cb_xprt);
1658 spin_lock(&nn->client_lock);
1659 WARN_ON_ONCE(atomic_read(&clp->cl_refcount));
1660 free_client(clp); 1651 free_client(clp);
1661 spin_unlock(&nn->client_lock);
1662} 1652}
1663 1653
1664static void 1654static void
@@ -1862,7 +1852,6 @@ static struct nfs4_client *create_client(struct xdr_netobj name,
1862 struct sockaddr *sa = svc_addr(rqstp); 1852 struct sockaddr *sa = svc_addr(rqstp);
1863 int ret; 1853 int ret;
1864 struct net *net = SVC_NET(rqstp); 1854 struct net *net = SVC_NET(rqstp);
1865 struct nfsd_net *nn = net_generic(net, nfsd_net_id);
1866 1855
1867 clp = alloc_client(name); 1856 clp = alloc_client(name);
1868 if (clp == NULL) 1857 if (clp == NULL)
@@ -1870,9 +1859,7 @@ static struct nfs4_client *create_client(struct xdr_netobj name,
1870 1859
1871 ret = copy_cred(&clp->cl_cred, &rqstp->rq_cred); 1860 ret = copy_cred(&clp->cl_cred, &rqstp->rq_cred);
1872 if (ret) { 1861 if (ret) {
1873 spin_lock(&nn->client_lock);
1874 free_client(clp); 1862 free_client(clp);
1875 spin_unlock(&nn->client_lock);
1876 return NULL; 1863 return NULL;
1877 } 1864 }
1878 INIT_WORK(&clp->cl_cb_null.cb_work, nfsd4_run_cb_null); 1865 INIT_WORK(&clp->cl_cb_null.cb_work, nfsd4_run_cb_null);