summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2003-08-18 19:33:52 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-08-18 19:33:52 -0700
commitebbbef610d7081e1820beb6ca375377c834b29c2 (patch)
tree5cb01f4d50e1c18acf4ea97546e7cbeb5aa4f428 /net
parentde9974b145132b5f330f2b6e8ffbaabadcb4626e (diff)
[PATCH] kNFSd: Make sure nothing happens to a dead rpc/tcp socket
Just make sure that once SK_DEAD is set, nothing is attempted on the socket.
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/svcsock.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 42f9f6bc359b..e5fe3ee84e1f 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -147,6 +147,8 @@ svc_sock_enqueue(struct svc_sock *svsk)
if (!(svsk->sk_flags &
( (1<<SK_CONN)|(1<<SK_DATA)|(1<<SK_CLOSE)|(1<<SK_DEFERRED)) ))
return;
+ if (test_bit(SK_DEAD, &svsk->sk_flags))
+ return;
spin_lock_bh(&serv->sv_lock);
@@ -1029,6 +1031,9 @@ svc_tcp_sendto(struct svc_rqst *rqstp)
reclen = htonl(0x80000000|((xbufp->len ) - 4));
memcpy(xbufp->head[0].iov_base, &reclen, 4);
+ if (test_bit(SK_DEAD, &rqstp->rq_sock->sk_flags))
+ return -ENOTCONN;
+
sent = svc_sendto(rqstp, &rqstp->rq_res);
if (sent != xbufp->len) {
printk(KERN_NOTICE "rpc-srv/tcp: %s: %s %d when sending %d bytes - shutting down socket\n",