]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: Improve accuracy of socket ENOBUFS determination
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 15 Mar 2022 03:05:07 +0000 (23:05 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 22 Mar 2022 19:52:55 +0000 (15:52 -0400)
commitcb823f05ce0e21fb5f5d152ebec10ba119bb5cc6
tree90d087e580835927d01d24447bbdc5d876a9a070
parent1eec2bfcc75597e5903c98d389074e03e59460d3
SUNRPC: Improve accuracy of socket ENOBUFS determination

The current code checks for whether or not the socket is in a writeable
state after we get an EAGAIN. That is racy, since we've dropped the
socket lock, so the amount of free buffer may have changed.

Instead, let's check whether the socket is writeable before we try to
write to it. If that was the case, we do expect the message to be at
least partially sent unless we're in a low memory situation.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
net/sunrpc/xprtsock.c