* [PATCH] kNFSd - 1 of 3 - Make sure nothing happens to a dead rpc/tcp socket
@ 2003-08-19 4:35 NeilBrown
0 siblings, 0 replies; only message in thread
From: NeilBrown @ 2003-08-19 4:35 UTC (permalink / raw)
To: Linus Torvalds; +Cc: nfs
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(+)
diff ./net/sunrpc/svcsock.c~current~ ./net/sunrpc/svcsock.c
--- ./net/sunrpc/svcsock.c~current~ 2003-08-18 09:41:01.000000000 +1000
+++ ./net/sunrpc/svcsock.c 2003-08-18 09:41:01.000000000 +1000
@@ -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 - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-08-19 4:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-19 4:35 [PATCH] kNFSd - 1 of 3 - Make sure nothing happens to a dead rpc/tcp socket NeilBrown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.