linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jack Wang <jinpu.wang@cloud.ionos.com>
To: linux-block@vger.kernel.org
Cc: axboe@kernel.dk, hch@infradead.org, bvanassche@acm.org,
	danil.kipnis@cloud.ionos.com, jinpu.wang@cloud.ionos.com,
	Gioh Kim <gi-oh.kim@cloud.ionos.com>
Subject: [PATCH for-next 3/3] block/rnbd-clt: send_msg_close if any error occurs after send_msg_open
Date: Tue, 13 Oct 2020 12:30:50 +0200	[thread overview]
Message-ID: <20201013103050.33269-4-jinpu.wang@cloud.ionos.com> (raw)
In-Reply-To: <20201013103050.33269-1-jinpu.wang@cloud.ionos.com>

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


  parent reply	other threads:[~2020-10-13 10:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2020-10-13 19:10 ` [PATCH for-next 0/3] misc fix and cleanup for rnbd Jens Axboe

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=20201013103050.33269-4-jinpu.wang@cloud.ionos.com \
    --to=jinpu.wang@cloud.ionos.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=danil.kipnis@cloud.ionos.com \
    --cc=gi-oh.kim@cloud.ionos.com \
    --cc=hch@infradead.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).