]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: fix race to sk_err after xs_error_report
authorBenjamin Coddington <bcodding@redhat.com>
Wed, 2 Oct 2019 14:40:55 +0000 (10:40 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 10 Oct 2019 20:14:28 +0000 (16:14 -0400)
commit4184554f6b11d429b3d17fb77da135925a4d859b
tree0c176e56553e0ac8c56b28794b6343128df56d6e
parent991f7a7428608a36b4e6d8dbde51801d10a3d3f9
SUNRPC: fix race to sk_err after xs_error_report

Since commit da9d2a839853 ("SUNRPC: Replace direct task wakeups from
softirq context") there has been a race to the value of the sk_err if both
XPRT_SOCK_WAKE_ERROR and XPRT_SOCK_WAKE_DISCONNECT are set.  In that case,
we may end up losing the sk_err value that existed when xs_error_report was
called.

Fix this by reverting to the previous behavior: instead of using SO_ERROR
to retrieve the value at a later time (which might also return sk_err_soft),
copy the sk_err value onto struct sock_xprt, and use that value to wake
pending tasks.

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Fixes: da9d2a839853 ("SUNRPC: Replace direct task wakeups from softirq context")
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
include/linux/sunrpc/xprtsock.h
net/sunrpc/xprtsock.c