Skip to contentSkip to conversation

kNFSd - 1 of 3 - Make sure nothing happens to a dead rpc/tcp socket

PATCH New NeilBrown 1 participant 1 message Aug 19, 2003

Subsystems (3)
lore
Share & tools
lore

NeilBrown

author
#0 lore raw

PATCH 1/1 kNFSd - 1 of 3 - Make sure nothing happens to a dead rpc/tcp socket

Three more little patches for knfsd in 2.6.0-test3 NeilBrown

### Comments for ChangeSet

Just make sure that once SK_DEAD is set, nothing is attempted on the socket.

----------- Diffstat output ------------

 ./net/sunrpc/svcsock.c |    5 +++++
 1 files changed, 5 insertions(+)
net/sunrpc/svcsock.c renamed from net/sunrpc/svcsock.c~current~ +5 -0
diff ./net/sunrpc/svcsock.c~current~ ./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",

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs