Skip to content
Commit 718ba5b8 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

SUNRPC: Add helpers to prevent socket create from racing



The socket lock is currently held by the task that is requesting the
connection be established. While that is efficient in the case where
the connection happens quickly, it is racy in the case where it doesn't.
What we really want is for the connect helper to be able to block access
to the socket while it is being set up.

This patch does so by arranging to transfer the socket lock from the
task that is requesting the connect attempt, and then releasing that
lock once everything is done.
This scheme also gives us automatic protection against collisions with
the RPC close code, so we can kill the cancel_delayed_work_sync()
call in xs_close().

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 6cc7e908
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment