Linux-Block Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH for-next 0/3] misc fix and cleanup for rnbd
@ 2020-10-13 10:30 Jack Wang
  2020-10-13 10:30 ` [PATCH for-next 1/3] block/rnbd-clt: remove nr argument from send_usr_msg Jack Wang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jack Wang @ 2020-10-13 10:30 UTC (permalink / raw)
  To: linux-block; +Cc: axboe, hch, bvanassche, danil.kipnis, jinpu.wang

Hi Jens,

Please consider to include following changes to upstream. 

The first one is just a resend, Gioh sent it 2 weeks ago, it got ignored
somehow.

The second one is just a small clean up.

The third one is a small bugfix.

Regards!
Jack Wang

Gioh Kim (1):
  block/rnbd-clt: send_msg_close if any error occurs after send_msg_open

Guoqing Jiang (1):
  block/rnbd-clt: remove nr argument from send_usr_msg

Jack Wang (1):
  block/rnbd-clt: do not cap max_hw_sectors & max_segments with remote
    device

 drivers/block/rnbd/rnbd-clt.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

-- 
2.25.1


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

* [PATCH for-next 1/3] block/rnbd-clt: remove nr argument from send_usr_msg
  2020-10-13 10:30 [PATCH for-next 0/3] misc fix and cleanup for rnbd Jack Wang
@ 2020-10-13 10:30 ` Jack Wang
  2020-10-13 10:30 ` [PATCH for-next 2/3] block/rnbd-clt: do not cap max_hw_sectors & max_segments with remote device Jack Wang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jack Wang @ 2020-10-13 10:30 UTC (permalink / raw)
  To: linux-block
  Cc: axboe, hch, bvanassche, danil.kipnis, jinpu.wang, Guoqing Jiang

From: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>

The argument is not needed since all callers pass 1 for it.

Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
---
 drivers/block/rnbd/rnbd-clt.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/block/rnbd/rnbd-clt.c b/drivers/block/rnbd/rnbd-clt.c
index cc6a4e2587ae..cffb750db7a4 100644
--- a/drivers/block/rnbd/rnbd-clt.c
+++ b/drivers/block/rnbd/rnbd-clt.c
@@ -433,7 +433,7 @@ enum wait_type {
 };
 
 static int send_usr_msg(struct rtrs_clt *rtrs, int dir,
-			struct rnbd_iu *iu, struct kvec *vec, size_t nr,
+			struct rnbd_iu *iu, struct kvec *vec,
 			size_t len, struct scatterlist *sg, unsigned int sg_len,
 			void (*conf)(struct work_struct *work),
 			int *errno, enum wait_type wait)
@@ -447,7 +447,7 @@ static int send_usr_msg(struct rtrs_clt *rtrs, int dir,
 		.conf_fn = msg_conf,
 	};
 	err = rtrs_clt_request(dir, &req_ops, rtrs, iu->permit,
-				vec, nr, len, sg, sg_len);
+				vec, 1, len, sg, sg_len);
 	if (!err && wait) {
 		wait_event(iu->comp.wait, iu->comp.errno != INT_MAX);
 		*errno = iu->comp.errno;
@@ -492,7 +492,7 @@ static int send_msg_close(struct rnbd_clt_dev *dev, u32 device_id, bool wait)
 	msg.device_id	= cpu_to_le32(device_id);
 
 	WARN_ON(!rnbd_clt_get_dev(dev));
-	err = send_usr_msg(sess->rtrs, WRITE, iu, &vec, 1, 0, NULL, 0,
+	err = send_usr_msg(sess->rtrs, WRITE, iu, &vec, 0, NULL, 0,
 			   msg_close_conf, &errno, wait);
 	if (err) {
 		rnbd_clt_put_dev(dev);
@@ -581,7 +581,7 @@ static int send_msg_open(struct rnbd_clt_dev *dev, bool wait)
 
 	WARN_ON(!rnbd_clt_get_dev(dev));
 	err = send_usr_msg(sess->rtrs, READ, iu,
-			   &vec, 1, sizeof(*rsp), iu->sglist, 1,
+			   &vec, sizeof(*rsp), iu->sglist, 1,
 			   msg_open_conf, &errno, wait);
 	if (err) {
 		rnbd_clt_put_dev(dev);
@@ -635,7 +635,7 @@ static int send_msg_sess_info(struct rnbd_clt_session *sess, bool wait)
 		goto put_iu;
 	}
 	err = send_usr_msg(sess->rtrs, READ, iu,
-			   &vec, 1, sizeof(*rsp), iu->sglist, 1,
+			   &vec, sizeof(*rsp), iu->sglist, 1,
 			   msg_sess_info_conf, &errno, wait);
 	if (err) {
 		rnbd_clt_put_sess(sess);
-- 
2.25.1


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

* [PATCH for-next 2/3] block/rnbd-clt: do not cap max_hw_sectors & max_segments with remote device
  2020-10-13 10:30 [PATCH for-next 0/3] misc fix and cleanup for rnbd Jack Wang
  2020-10-13 10:30 ` [PATCH for-next 1/3] block/rnbd-clt: remove nr argument from send_usr_msg Jack Wang
@ 2020-10-13 10:30 ` Jack Wang
  2020-10-13 10:30 ` [PATCH for-next 3/3] block/rnbd-clt: send_msg_close if any error occurs after send_msg_open Jack Wang
  2020-10-13 19:10 ` [PATCH for-next 0/3] misc fix and cleanup for rnbd Jens Axboe
  3 siblings, 0 replies; 5+ messages in thread
From: Jack Wang @ 2020-10-13 10:30 UTC (permalink / raw)
  To: linux-block; +Cc: axboe, hch, bvanassche, danil.kipnis, jinpu.wang

The max_hw_secotrs is only limited by the transport, not remote device,
block layer on server side will split to the device limit if it's too
big.

The max_segments, similar, and rtrs server will submit single buffer, so
no need to cap.

Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
---
 drivers/block/rnbd/rnbd-clt.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/block/rnbd/rnbd-clt.c b/drivers/block/rnbd/rnbd-clt.c
index cffb750db7a4..22381aee1cf4 100644
--- a/drivers/block/rnbd/rnbd-clt.c
+++ b/drivers/block/rnbd/rnbd-clt.c
@@ -91,11 +91,6 @@ static int rnbd_clt_set_dev_attr(struct rnbd_clt_dev *dev,
 	dev->max_hw_sectors = sess->max_io_size / SECTOR_SIZE;
 	dev->max_segments = BMAX_SEGMENTS;
 
-	dev->max_hw_sectors = min_t(u32, dev->max_hw_sectors,
-				    le32_to_cpu(rsp->max_hw_sectors));
-	dev->max_segments = min_t(u16, dev->max_segments,
-				  le16_to_cpu(rsp->max_segments));
-
 	return 0;
 }
 
-- 
2.25.1


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

* [PATCH for-next 3/3] block/rnbd-clt: send_msg_close if any error occurs after send_msg_open
  2020-10-13 10:30 [PATCH for-next 0/3] misc fix and cleanup for rnbd Jack Wang
  2020-10-13 10:30 ` [PATCH for-next 1/3] block/rnbd-clt: remove nr argument from send_usr_msg Jack Wang
  2020-10-13 10:30 ` [PATCH for-next 2/3] block/rnbd-clt: do not cap max_hw_sectors & max_segments with remote device Jack Wang
@ 2020-10-13 10:30 ` Jack Wang
  2020-10-13 19:10 ` [PATCH for-next 0/3] misc fix and cleanup for rnbd Jens Axboe
  3 siblings, 0 replies; 5+ messages in thread
From: Jack Wang @ 2020-10-13 10:30 UTC (permalink / raw)
  To: linux-block; +Cc: axboe, hch, bvanassche, danil.kipnis, jinpu.wang, Gioh Kim

From: Gioh Kim <gi-oh.kim@cloud.ionos.com>

After send_msg_open is done, send_msg_close should be done
if any error occurs and it is necessary to recover
what has been done.

Signed-off-by: Gioh Kim <gi-oh.kim@cloud.ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
---
 drivers/block/rnbd/rnbd-clt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/block/rnbd/rnbd-clt.c b/drivers/block/rnbd/rnbd-clt.c
index 22381aee1cf4..9ab9c467f272 100644
--- a/drivers/block/rnbd/rnbd-clt.c
+++ b/drivers/block/rnbd/rnbd-clt.c
@@ -1515,7 +1515,7 @@ struct rnbd_clt_dev *rnbd_clt_map_device(const char *sessname,
 			      "map_device: Failed to configure device, err: %d\n",
 			      ret);
 		mutex_unlock(&dev->lock);
-		goto del_dev;
+		goto send_close;
 	}
 
 	rnbd_clt_info(dev,
@@ -1534,6 +1534,8 @@ struct rnbd_clt_dev *rnbd_clt_map_device(const char *sessname,
 
 	return dev;
 
+send_close:
+	send_msg_close(dev, dev->device_id, WAIT);
 del_dev:
 	delete_dev(dev);
 put_dev:
-- 
2.25.1


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

* Re: [PATCH for-next 0/3] misc fix and cleanup for rnbd
  2020-10-13 10:30 [PATCH for-next 0/3] misc fix and cleanup for rnbd Jack Wang
                   ` (2 preceding siblings ...)
  2020-10-13 10:30 ` [PATCH for-next 3/3] block/rnbd-clt: send_msg_close if any error occurs after send_msg_open Jack Wang
@ 2020-10-13 19:10 ` Jens Axboe
  3 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2020-10-13 19:10 UTC (permalink / raw)
  To: Jack Wang, linux-block; +Cc: hch, bvanassche, danil.kipnis

On 10/13/20 4:30 AM, Jack Wang wrote:
> Hi Jens,
> 
> Please consider to include following changes to upstream. 
> 
> The first one is just a resend, Gioh sent it 2 weeks ago, it got ignored
> somehow.
> 
> The second one is just a small clean up.
> 
> The third one is a small bugfix.

Applied, thanks.

-- 
Jens Axboe


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

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-13 10:30 [PATCH for-next 0/3] misc fix and cleanup for rnbd Jack Wang
2020-10-13 10:30 ` [PATCH for-next 1/3] block/rnbd-clt: remove nr argument from send_usr_msg Jack Wang
2020-10-13 10:30 ` [PATCH for-next 2/3] block/rnbd-clt: do not cap max_hw_sectors & max_segments with remote device Jack Wang
2020-10-13 10:30 ` [PATCH for-next 3/3] block/rnbd-clt: send_msg_close if any error occurs after send_msg_open Jack Wang
2020-10-13 19:10 ` [PATCH for-next 0/3] misc fix and cleanup for rnbd Jens Axboe

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org
	public-inbox-index linux-block

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git