netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Zhengchao Shao <shaozhengchao@huawei.com>
Cc: v9fs-developer@lists.sourceforge.net, netdev@vger.kernel.org,
	ericvh@gmail.com, lucho@ionkov.net, asmadeus@codewreck.org,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, linux_oss@crudebyte.com,
	tom@opengridcomputing.com, weiyongjun1@huawei.com,
	yuehaibing@huawei.com
Subject: Re: [PATCH] 9p/rdma: unmap receive dma buffer in rdma_request()
Date: Wed, 28 Dec 2022 11:35:30 +0200	[thread overview]
Message-ID: <Y6wN4uBZwPV+rKXi@unreal> (raw)
In-Reply-To: <20221220031223.3890143-1-shaozhengchao@huawei.com>

On Tue, Dec 20, 2022 at 11:12:23AM +0800, Zhengchao Shao wrote:
> When down_interruptible() failed in rdma_request(), receive dma buffer
> is not unmapped. Add unmap action to error path.
> 
> Fixes: fc79d4b104f0 ("9p: rdma: RDMA Transport Support for 9P")
> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
> ---
>  net/9p/trans_rdma.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c
> index 83f9100d46bf..da83023fecbf 100644
> --- a/net/9p/trans_rdma.c
> +++ b/net/9p/trans_rdma.c
> @@ -499,6 +499,8 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req)
>  
>  	if (down_interruptible(&rdma->sq_sem)) {
>  		err = -EINTR;
> +		ib_dma_unmap_single(rdma->cm_id->device, c->busa,
> +				    c->req->tc.size, DMA_TO_DEVICE);
>  		goto send_error;
>  	}

It is not the only place where ib_dma_unmap_single() wasn't called.
Even at the same function if ib_post_send() fails, the unmap is not
called. Also post_recv() is missing call to ib_dma_unmap_single() too.

Thanks

>  
> -- 
> 2.34.1
> 

  reply	other threads:[~2022-12-28  9:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-20  3:12 [PATCH] 9p/rdma: unmap receive dma buffer in rdma_request() Zhengchao Shao
2022-12-28  9:35 ` Leon Romanovsky [this message]
2023-01-04  1:30   ` shaozhengchao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y6wN4uBZwPV+rKXi@unreal \
    --to=leon@kernel.org \
    --cc=asmadeus@codewreck.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ericvh@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shaozhengchao@huawei.com \
    --cc=tom@opengridcomputing.com \
    --cc=v9fs-developer@lists.sourceforge.net \
    --cc=weiyongjun1@huawei.com \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).