Re: [PATCH 1/3] rnbd-srv: fix the return value of rnbd_srv_rdma_ev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 30, 2022 at 2:39 PM Guoqing Jiang <guoqing.jiang@xxxxxxxxx> 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@xxxxxxxxx>
> ---
>  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.

>  }
>
>  static struct rnbd_srv_sess_dev
> --
> 2.34.1
>



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux