diff options
Diffstat (limited to 'net/sunrpc/svcsock.c')
-rw-r--r-- | net/sunrpc/svcsock.c | 30 |
1 files changed, 14 insertions, 16 deletions
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 | |||
300 | svc_sock_put(struct svc_sock *svsk) | 300 | svc_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 | /* |