Small changes for rnbd-srv
Subsystems (2)
v2 cover Small changes for rnbd-srv
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(-)
Signature · 1 line
2.31.1
PATCH v2 1/3 rnbd-srv: add comment in rnbd_srv_rdma_ev
Let's add some explanations here given the err handling is not obvious.
--- drivers/block/rnbd/rnbd-srv.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/block/rnbd/rnbd-srv.c +5 -0
@@ -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 ; }
Signature · 1 line
2.31.1
Re: [PATCH V2 1/3] rnbd-srv: add comment in rnbd_srv_rdma_ev
Quoted 5 lines · Guoqing Jiang
Let's add some explanations here given the err handling is not obvious.
Signed-off-by Guoqing Jiang <[email protected]>---
Thanks.
Quoted 22 lines
drivers/block/rnbd/rnbd-srv.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/block/rnbd/rnbd-srv.c +5
-1@@ -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
PATCH v2 2/3 rnbd-srv: make process_msg_close returns void
In reply to Guoqing JiangChange the return type to void given it always returns 0.
--- drivers/block/rnbd/rnbd-srv.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/block/rnbd/rnbd-srv.c +3 -4
@@ -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);
Signature · 1 line
2.31.1
PATCH v2 3/3 rnbd-srv: remove redundant setting of blk_open_flags
In reply to Guoqing JiangIt is not necessary since it is set later just before function return success.
--- drivers/block/rnbd/rnbd-srv-dev.c | 1 - 1 file changed, 1 deletion(-)
drivers/block/rnbd/rnbd-srv-dev.c +0 -1
@@ -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)
Signature · 1 line
2.31.1
Quoted 8 lines · Guoqing Jiang
Pls review if the new added comment in the first patch is appropriate.
Thanks,
GuoqingV2 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: 8807707df7ef09d679df2b21894d49a06fd8ba7eBest regards,
Signature · 1 line
Jens Axboe