All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/3] Small changes for rnbd-srv
@ 2022-09-02 10:00 Guoqing Jiang
  2022-09-02 10:00 ` [PATCH V2 1/3] rnbd-srv: add comment in rnbd_srv_rdma_ev Guoqing Jiang
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Guoqing Jiang @ 2022-09-02 10:00 UTC (permalink / raw)
  To: haris.iqbal, jinpu.wang, axboe; +Cc: linux-block

Hi,

Pls review if the new added comment in the first patch is appropriate.

Thanks,
Guoqing

V2 changes:

1. modifiy the first one to add comment in rnbd_srv_rdma_ev

Guoqing Jiang (3):
  rnbd-srv: add comment in rnbd_srv_rdma_ev
  rnbd-srv: make process_msg_close returns void
  rnbd-srv: remove redundant setting of blk_open_flags

 drivers/block/rnbd/rnbd-srv-dev.c |  1 -
 drivers/block/rnbd/rnbd-srv.c     | 12 ++++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH V2 1/3] rnbd-srv: add comment in rnbd_srv_rdma_ev
  2022-09-02 10:00 [PATCH V2 0/3] Small changes for rnbd-srv Guoqing Jiang
@ 2022-09-02 10:00 ` Guoqing Jiang
  2022-09-05 11:41   ` Haris Iqbal
  2022-09-02 10:00 ` [PATCH V2 2/3] rnbd-srv: make process_msg_close returns void Guoqing Jiang
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Guoqing Jiang @ 2022-09-02 10:00 UTC (permalink / raw)
  To: haris.iqbal, jinpu.wang, axboe; +Cc: linux-block

Let's add some explanations here given the err handling is not obvious.

Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
---
 drivers/block/rnbd/rnbd-srv.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index 3f6c268e04ef..a229dd87c322 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -402,6 +402,11 @@ static int rnbd_srv_rdma_ev(void *priv,
 		return -EINVAL;
 	}
 
+	/*
+	 * Since ret is passed to rtrs to handle the failure case, we
+	 * just return 0 at the end otherwise callers in rtrs would call
+	 * send_io_resp_imm again to print redundant err message.
+	 */
 	rtrs_srv_resp_rdma(id, ret);
 	return 0;
 }
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH V2 2/3] rnbd-srv: make process_msg_close returns void
  2022-09-02 10:00 [PATCH V2 0/3] Small changes for rnbd-srv Guoqing Jiang
  2022-09-02 10:00 ` [PATCH V2 1/3] rnbd-srv: add comment in rnbd_srv_rdma_ev Guoqing Jiang
@ 2022-09-02 10:00 ` Guoqing Jiang
  2022-09-02 10:00 ` [PATCH V2 3/3] rnbd-srv: remove redundant setting of blk_open_flags Guoqing Jiang
  2022-09-05 17:46 ` [PATCH V2 0/3] Small changes for rnbd-srv Jens Axboe
  3 siblings, 0 replies; 6+ messages in thread
From: Guoqing Jiang @ 2022-09-02 10:00 UTC (permalink / raw)
  To: haris.iqbal, jinpu.wang, axboe; +Cc: linux-block

Change the return type to void given it always returns 0.

Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Acked-by: Md Haris Iqbal <haris.iqbal@ionos.com>
---
 drivers/block/rnbd/rnbd-srv.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index a229dd87c322..8d011652a15c 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -339,7 +339,7 @@ void rnbd_srv_sess_dev_force_close(struct rnbd_srv_sess_dev *sess_dev,
 	mutex_unlock(&sess->lock);
 }
 
-static int process_msg_close(struct rnbd_srv_session *srv_sess,
+static void process_msg_close(struct rnbd_srv_session *srv_sess,
 			     void *data, size_t datalen, const void *usr,
 			     size_t usrlen)
 {
@@ -351,13 +351,12 @@ static int process_msg_close(struct rnbd_srv_session *srv_sess,
 	sess_dev = rnbd_get_sess_dev(le32_to_cpu(close_msg->device_id),
 				      srv_sess);
 	if (IS_ERR(sess_dev))
-		return 0;
+		return;
 
 	rnbd_put_sess_dev(sess_dev);
 	mutex_lock(&srv_sess->lock);
 	rnbd_srv_destroy_dev_session_sysfs(sess_dev);
 	mutex_unlock(&srv_sess->lock);
-	return 0;
 }
 
 static int process_msg_open(struct rnbd_srv_session *srv_sess,
@@ -387,7 +386,7 @@ static int rnbd_srv_rdma_ev(void *priv,
 	case RNBD_MSG_IO:
 		return process_rdma(srv_sess, id, data, datalen, usr, usrlen);
 	case RNBD_MSG_CLOSE:
-		ret = process_msg_close(srv_sess, data, datalen, usr, usrlen);
+		process_msg_close(srv_sess, data, datalen, usr, usrlen);
 		break;
 	case RNBD_MSG_OPEN:
 		ret = process_msg_open(srv_sess, usr, usrlen, data, datalen);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH V2 3/3] rnbd-srv: remove redundant setting of blk_open_flags
  2022-09-02 10:00 [PATCH V2 0/3] Small changes for rnbd-srv Guoqing Jiang
  2022-09-02 10:00 ` [PATCH V2 1/3] rnbd-srv: add comment in rnbd_srv_rdma_ev Guoqing Jiang
  2022-09-02 10:00 ` [PATCH V2 2/3] rnbd-srv: make process_msg_close returns void Guoqing Jiang
@ 2022-09-02 10:00 ` Guoqing Jiang
  2022-09-05 17:46 ` [PATCH V2 0/3] Small changes for rnbd-srv Jens Axboe
  3 siblings, 0 replies; 6+ messages in thread
From: Guoqing Jiang @ 2022-09-02 10:00 UTC (permalink / raw)
  To: haris.iqbal, jinpu.wang, axboe; +Cc: linux-block

It is not necessary since it is set later just before function
return success.

Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Acked-by: Md Haris Iqbal <haris.iqbal@ionos.com>
---
 drivers/block/rnbd/rnbd-srv-dev.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/block/rnbd/rnbd-srv-dev.c b/drivers/block/rnbd/rnbd-srv-dev.c
index c63017f6e421..38131fa5718d 100644
--- a/drivers/block/rnbd/rnbd-srv-dev.c
+++ b/drivers/block/rnbd/rnbd-srv-dev.c
@@ -21,7 +21,6 @@ struct rnbd_dev *rnbd_dev_open(const char *path, fmode_t flags)
 	if (!dev)
 		return ERR_PTR(-ENOMEM);
 
-	dev->blk_open_flags = flags;
 	dev->bdev = blkdev_get_by_path(path, flags, THIS_MODULE);
 	ret = PTR_ERR_OR_ZERO(dev->bdev);
 	if (ret)
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH V2 1/3] rnbd-srv: add comment in rnbd_srv_rdma_ev
  2022-09-02 10:00 ` [PATCH V2 1/3] rnbd-srv: add comment in rnbd_srv_rdma_ev Guoqing Jiang
@ 2022-09-05 11:41   ` Haris Iqbal
  0 siblings, 0 replies; 6+ messages in thread
From: Haris Iqbal @ 2022-09-05 11:41 UTC (permalink / raw)
  To: Guoqing Jiang; +Cc: jinpu.wang, axboe, linux-block

On Fri, Sep 2, 2022 at 12:01 PM Guoqing Jiang <guoqing.jiang@linux.dev> wrote:
>
> Let's add some explanations here given the err handling is not obvious.
>
> Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
> ---

Acked-by: Md Haris Iqbal <haris.iqbal@ionos.com>

Thanks.

>  drivers/block/rnbd/rnbd-srv.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
> index 3f6c268e04ef..a229dd87c322 100644
> --- a/drivers/block/rnbd/rnbd-srv.c
> +++ b/drivers/block/rnbd/rnbd-srv.c
> @@ -402,6 +402,11 @@ static int rnbd_srv_rdma_ev(void *priv,
>                 return -EINVAL;
>         }
>
> +       /*
> +        * Since ret is passed to rtrs to handle the failure case, we
> +        * just return 0 at the end otherwise callers in rtrs would call
> +        * send_io_resp_imm again to print redundant err message.
> +        */
>         rtrs_srv_resp_rdma(id, ret);
>         return 0;
>  }
> --
> 2.31.1
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2 0/3] Small changes for rnbd-srv
  2022-09-02 10:00 [PATCH V2 0/3] Small changes for rnbd-srv Guoqing Jiang
                   ` (2 preceding siblings ...)
  2022-09-02 10:00 ` [PATCH V2 3/3] rnbd-srv: remove redundant setting of blk_open_flags Guoqing Jiang
@ 2022-09-05 17:46 ` Jens Axboe
  3 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2022-09-05 17:46 UTC (permalink / raw)
  To: haris.iqbal, Guoqing Jiang, jinpu.wang; +Cc: linux-block

On Fri, 2 Sep 2022 18:00:52 +0800, Guoqing Jiang wrote:
> Pls review if the new added comment in the first patch is appropriate.
> 
> Thanks,
> Guoqing
> 
> V2 changes:
> 
> [...]

Applied, thanks!

[1/3] rnbd-srv: add comment in rnbd_srv_rdma_ev
      commit: 095134fbc2d4126d0575485e52139967f0771e30
[2/3] rnbd-srv: make process_msg_close returns void
      commit: be2b2f6b62b55bbb30eb611c1730cd9056dbf7bd
[3/3] rnbd-srv: remove redundant setting of blk_open_flags
      commit: 8807707df7ef09d679df2b21894d49a06fd8ba7e

Best regards,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-05 17:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-02 10:00 [PATCH V2 0/3] Small changes for rnbd-srv Guoqing Jiang
2022-09-02 10:00 ` [PATCH V2 1/3] rnbd-srv: add comment in rnbd_srv_rdma_ev Guoqing Jiang
2022-09-05 11:41   ` Haris Iqbal
2022-09-02 10:00 ` [PATCH V2 2/3] rnbd-srv: make process_msg_close returns void Guoqing Jiang
2022-09-02 10:00 ` [PATCH V2 3/3] rnbd-srv: remove redundant setting of blk_open_flags Guoqing Jiang
2022-09-05 17:46 ` [PATCH V2 0/3] Small changes for rnbd-srv Jens Axboe

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.