From: Guoqing Jiang <guoqing.jiang@linux.dev>
To: Haris Iqbal <haris.iqbal@ionos.com>
Cc: jinpu.wang@ionos.com, axboe@kernel.dk, linux-block@vger.kernel.org
Subject: Re: [PATCH 1/3] rnbd-srv: fix the return value of rnbd_srv_rdma_ev
Date: Tue, 30 Aug 2022 23:10:20 +0800 [thread overview]
Message-ID: <8765c12f-eb29-b5f5-b15f-5d09e32eca21@linux.dev> (raw)
In-Reply-To: <CAJpMwyhT4mnbA4xi2xD4-EeJeXNJL6oQ66QfbddnPdZZBWA2_g@mail.gmail.com>
On 8/30/22 9:28 PM, Haris Iqbal wrote:
> On Tue, Aug 30, 2022 at 2:39 PM Guoqing Jiang <guoqing.jiang@linux.dev> wrote:
>> Since process_msg_open could fail, we should return 'ret'
>> instead of '0' at the end of function.
>>
>> Fixes: 2de6c8de192b ("block/rnbd: server: main functionality")
>> Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
>> ---
>> drivers/block/rnbd/rnbd-srv.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
>> index 3f6c268e04ef..9182d45cb9be 100644
>> --- a/drivers/block/rnbd/rnbd-srv.c
>> +++ b/drivers/block/rnbd/rnbd-srv.c
>> @@ -403,7 +403,7 @@ static int rnbd_srv_rdma_ev(void *priv,
>> }
>>
>> rtrs_srv_resp_rdma(id, ret);
>> - return 0;
>> + return ret;
> I think the point here was to process the failure through
> rtrs_srv_resp_rdma() function. If you notice how the return of rdma_ev
> is processed by RTRS, in case of a failure return; it tries to send a
> response back through send_io_resp_imm(). Same would happen in the
> function rtrs_srv_resp_rdma().
>
> If we call rtrs_srv_resp_rdma() with the error, and return the err
> back to the caller of rdma_ev, we may end up sending err response more
> than once.
Thanks for the explanation, I am wondering if it makes sense to call
rtrs_srv_resp_rdma when ret == 0, or let's just add a comment here.
Thanks,
Guoqing
next prev parent reply other threads:[~2022-08-30 15:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-30 12:39 [PATCH 0/3] Small changes for rnbd-srv Guoqing Jiang
2022-08-30 12:39 ` [PATCH 1/3] rnbd-srv: fix the return value of rnbd_srv_rdma_ev Guoqing Jiang
2022-08-30 12:49 ` Chaitanya Kulkarni
2022-08-30 13:28 ` Haris Iqbal
2022-08-30 15:10 ` Guoqing Jiang [this message]
2022-08-30 15:50 ` Jinpu Wang
2022-08-30 12:39 ` [PATCH 2/3] rnbd-srv: make process_msg_close returns void Guoqing Jiang
2022-08-30 13:04 ` Chaitanya Kulkarni
2022-08-30 13:31 ` Haris Iqbal
2022-08-30 12:39 ` [PATCH 3/3] rnbd-srv: remove redundant setting of blk_open_flags Guoqing Jiang
2022-08-30 13:01 ` Chaitanya Kulkarni
2022-08-30 13:30 ` Haris Iqbal
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=8765c12f-eb29-b5f5-b15f-5d09e32eca21@linux.dev \
--to=guoqing.jiang@linux.dev \
--cc=axboe@kernel.dk \
--cc=haris.iqbal@ionos.com \
--cc=jinpu.wang@ionos.com \
--cc=linux-block@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.