diff options
author | Dominique Martinet <dominique.martinet@cea.fr> | 2014-01-17 18:31:00 +0100 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2014-03-25 16:37:59 -0500 |
commit | 2b6e72ed747f68a038df616efd86744b3644d694 (patch) | |
tree | d781427484432608a74ccc44fd4a7a3296751f23 /net/9p/trans_rdma.c | |
parent | 38dbfb59d1175ef458d006556061adeaa8751b72 (diff) | |
download | linux-2b6e72ed747f68a038df616efd86744b3644d694.tar.gz linux-2b6e72ed747f68a038df616efd86744b3644d694.tar.xz |
9P: Add memory barriers to protect request fields over cb/rpc threads handoff
We need barriers to guarantee this pattern works as intended:
[w] req->rc, 1 [r] req->status, 1
wmb rmb
[w] req->status, 1 [r] req->rc
Where the wmb ensures that rc gets written before status,
and the rmb ensures that if you observe status == 1, rc is the new value.
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p/trans_rdma.c')
-rw-r--r-- | net/9p/trans_rdma.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index 8f68df5d2973..f127ae504911 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c @@ -305,8 +305,7 @@ handle_recv(struct p9_client *client, struct p9_trans_rdma *rdma, } req->rc = c->rc; - req->status = REQ_STATUS_RCVD; - p9_client_cb(client, req); + p9_client_cb(client, req, REQ_STATUS_RCVD); return; |