Skip to content

Commit

Permalink
9pnet_rdma: update request status during send
Browse files Browse the repository at this point in the history
This will be needed by the flush logic.

Signed-off-by: Simon Derr <[email protected]>
Signed-off-by: Eric Van Hensbergen <[email protected]>
  • Loading branch information
sderr authored and ericvh committed Mar 25, 2014
1 parent afd8d65 commit 3f9d5b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/9p/trans_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,11 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req)
goto send_error;
}

/* Mark request as `sent' *before* we actually send it,
* because doing if after could erase the REQ_STATUS_RCVD
* status in case of a very fast reply.
*/
req->status = REQ_STATUS_SENT;
err = ib_post_send(rdma->qp, &wr, &bad_wr);
if (err)
goto send_error;
Expand All @@ -519,6 +524,7 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req)

/* Handle errors that happened during or while preparing the send: */
send_error:
req->status = REQ_STATUS_ERROR;
kfree(c);
p9_debug(P9_DEBUG_ERROR, "Error %d in rdma_request()\n", err);

Expand Down

0 comments on commit 3f9d5b8

Please sign in to comment.