xprtrdma: Improve locking around rpcrdma_rep destruction
authorChuck Lever <chuck.lever@oracle.com>
Sat, 24 Apr 2021 19:02:28 +0000 (15:02 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 26 Apr 2021 13:22:29 +0000 (09:22 -0400)
commiteaf86e8cc85c4abf3e4a2a0d3f59af613d2bacab
tree6fe16b108cf0e2181e8bbe4cdfe9601cc1916566
parent5030c9a938f875f31932928632e1597f03e79ace
xprtrdma: Improve locking around rpcrdma_rep destruction

Currently rpcrdma_reps_destroy() assumes that, at transport
tear-down, the content of the rb_free_reps list is the same as the
content of the rb_all_reps list. Although that is usually true,
using the rb_all_reps list should be more reliable because of
the way it's managed. And, rpcrdma_reps_unmap() uses rb_all_reps;
these two functions should both traverse the "all" list.

Ensure that all rpcrdma_reps are always destroyed whether they are
on the rep free list or not.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
net/sunrpc/xprtrdma/verbs.c