• T
    SUNRPC: Fix a potential race in xprt_connect() · 20595815
    Trond Myklebust 提交于
    [ Upstream commit 0a9a4304f3614e25d9de9b63502ca633c01c0d70 ]
    
    If an asynchronous connection attempt completes while another task is
    in xprt_connect(), then the call to rpc_sleep_on() could end up
    racing with the call to xprt_wake_pending_tasks().
    So add a second test of the connection state after we've put the
    task to sleep and set the XPRT_CONNECTING flag, when we know that there
    can be no asynchronous connection attempts still in progress.
    
    Fixes: 0b9e7943 ("SUNRPC: Move the test for XPRT_CONNECTING into...")
    Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: NSasha Levin <sashal@kernel.org>
    20595815
xprt.c 40.4 KB