aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/svcauth.c4
-rw-r--r--net/sunrpc/svcsock.c30
2 files changed, 15 insertions, 19 deletions
diff --git a/net/sunrpc/svcauth.c b/net/sunrpc/svcauth.c
index 8f2320aded5c..0004c1f0ef04 100644
--- a/net/sunrpc/svcauth.c
+++ b/net/sunrpc/svcauth.c
@@ -147,10 +147,8 @@ auth_domain_lookup(char *name, struct auth_domain *new)
147 return hp; 147 return hp;
148 } 148 }
149 } 149 }
150 if (new) { 150 if (new)
151 hlist_add_head(&new->hash, head); 151 hlist_add_head(&new->hash, head);
152 kref_get(&new->ref);
153 }
154 spin_unlock(&auth_domain_lock); 152 spin_unlock(&auth_domain_lock);
155 return new; 153 return new;
156} 154}
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 96521f16342b..db0d1048d466 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -300,8 +300,13 @@ static inline void
300svc_sock_put(struct svc_sock *svsk) 300svc_sock_put(struct svc_sock *svsk)
301{ 301{
302 if (atomic_dec_and_test(&svsk->sk_inuse) && test_bit(SK_DEAD, &svsk->sk_flags)) { 302 if (atomic_dec_and_test(&svsk->sk_inuse) && test_bit(SK_DEAD, &svsk->sk_flags)) {
303 dprintk("svc: releasing dead socket\n"); 303 printk("svc: releasing dead socket\n");
304 sock_release(svsk->sk_sock); 304 if (svsk->sk_sock->file)
305 sockfd_put(svsk->sk_sock);
306 else
307 sock_release(svsk->sk_sock);
308 if (svsk->sk_info_authunix != NULL)
309 svcauth_unix_info_release(svsk->sk_info_authunix);
305 kfree(svsk); 310 kfree(svsk);
306 } 311 }
307} 312}
@@ -1604,20 +1609,13 @@ svc_delete_socket(struct svc_sock *svsk)
1604 if (test_bit(SK_TEMP, &svsk->sk_flags)) 1609 if (test_bit(SK_TEMP, &svsk->sk_flags))
1605 serv->sv_tmpcnt--; 1610 serv->sv_tmpcnt--;
1606 1611
1607 if (!atomic_read(&svsk->sk_inuse)) { 1612 /* This atomic_inc should be needed - svc_delete_socket
1608 spin_unlock_bh(&serv->sv_lock); 1613 * should have the semantic of dropping a reference.
1609 if (svsk->sk_sock->file) 1614 * But it doesn't yet....
1610 sockfd_put(svsk->sk_sock); 1615 */
1611 else 1616 atomic_inc(&svsk->sk_inuse);
1612 sock_release(svsk->sk_sock); 1617 spin_unlock_bh(&serv->sv_lock);
1613 if (svsk->sk_info_authunix != NULL) 1618 svc_sock_put(svsk);
1614 svcauth_unix_info_release(svsk->sk_info_authunix);
1615 kfree(svsk);
1616 } else {
1617 spin_unlock_bh(&serv->sv_lock);
1618 dprintk(KERN_NOTICE "svc: server socket destroy delayed\n");
1619 /* svsk->sk_server = NULL; */
1620 }
1621} 1619}
1622 1620
1623/* 1621/*