SUNRPC: xprt_clear_locked() only needs release memory semantics

The clearing of the XPRT_LOCKED bit has to happen after we clear
xprt->snd_task, but we don't require any extra memory barriers after
that.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
Trond Myklebust 2021-07-12 12:34:34 -04:00
parent b9f8713f42
commit 33c3214bf4
1 changed files with 3 additions and 5 deletions

View File

@ -246,11 +246,9 @@ EXPORT_SYMBOL_GPL(xprt_find_transport_ident);
static void xprt_clear_locked(struct rpc_xprt *xprt)
{
xprt->snd_task = NULL;
if (!test_bit(XPRT_CLOSE_WAIT, &xprt->state)) {
smp_mb__before_atomic();
clear_bit(XPRT_LOCKED, &xprt->state);
smp_mb__after_atomic();
} else
if (!test_bit(XPRT_CLOSE_WAIT, &xprt->state))
clear_bit_unlock(XPRT_LOCKED, &xprt->state);
else
queue_work(xprtiod_workqueue, &xprt->task_cleanup);
}