]> git.baikalelectronics.ru Git - kernel.git/commit
svcrpc: sends on closed socket should stop immediately
authorJ. Bruce Fields <bfields@redhat.com>
Mon, 20 Aug 2012 20:04:40 +0000 (16:04 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 20 Aug 2012 22:38:59 +0000 (18:38 -0400)
commitc8c22fcca5d959e91b4bc7cd26e558f820ad74a9
tree14dc65ebb5dc175f68a099f0aaf36b447e1fdcd8
parentda2fa4007d88d2b48ef8685154db0444eccaf52c
svcrpc: sends on closed socket should stop immediately

svc_tcp_sendto sets XPT_CLOSE if we fail to transmit the entire reply.
However, the XPT_CLOSE won't be acted on immediately.  Meanwhile other
threads could send further replies before the socket is really shut
down.  This can manifest as data corruption: for example, if a truncated
read reply is followed by another rpc reply, that second reply will look
to the client like further read data.

Symptoms were data corruption preceded by svc_tcp_sendto logging
something like

kernel: rpc-srv/tcp: nfsd: sent only 963696 when sending 1048708 bytes - shutting down socket

Cc: stable@vger.kernel.org
Reported-by: Malahal Naineni <malahal@us.ibm.com>
Tested-by: Malahal Naineni <malahal@us.ibm.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
net/sunrpc/svc_xprt.c