lkml.org 
[lkml]   [2022]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/5] 9p: fix miss unmap request in 'rdma_request()'
Date
From: Ye Bin <yebin10@huawei.com>

If send request failed or fail to get semaphore will not call 'send_done()',
request may miss to unmap. So add unmap handle above error.

Signed-off-by: Ye Bin <yebin10@huawei.com>
---
net/9p/trans_rdma.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c
index 6ff706760676..e498208ed72b 100644
--- a/net/9p/trans_rdma.c
+++ b/net/9p/trans_rdma.c
@@ -500,7 +500,7 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req)

if (down_interruptible(&rdma->sq_sem)) {
err = -EINTR;
- goto send_error;
+ goto mapping_error;
}

/* Mark request as `sent' *before* we actually send it,
@@ -510,12 +510,15 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req)
req->status = REQ_STATUS_SENT;
err = ib_post_send(rdma->qp, &wr, NULL);
if (err)
- goto send_error;
+ goto mapping_error;

/* Success */
return 0;

/* Handle errors that happened during or while preparing the send: */
+ mapping_error:
+ ib_dma_unmap_single(rdma->cm_id->device, c->busa,
+ c->req->tc.size, DMA_TO_DEVICE);
send_error:
req->status = REQ_STATUS_ERROR;
kfree(c);
--
2.31.1
\
 
 \ /
  Last update: 2022-11-21 08:40    [W:0.709 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site