sunrpc: Fix potential race conditions in rpc_sysfs_xprt_state_change()
authorAnna Schumaker <Anna.Schumaker@Netapp.com>
Mon, 15 Nov 2021 16:54:25 +0000 (11:54 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Feb 2022 11:56:10 +0000 (12:56 +0100)
commit4403233b87758d9d50fc764c16f85ab14b68439f
tree31f93e3857a30079cee1e61a6746e9811c7e20d9
parent4b22aa42bd4d2d630ef1854c139275c3532937cb
sunrpc: Fix potential race conditions in rpc_sysfs_xprt_state_change()

[ Upstream commit 1a48db3fef499f615b56093947ec4b0d3d8e3021 ]

We need to use test_and_set_bit() when changing xprt state flags to
avoid potentially getting xps->xps_nactive out of sync.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sunrpc/sysfs.c