[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200918072356.10331-1-gi-oh.kim@clous.ionos.com>
Date: Fri, 18 Sep 2020 09:23:56 +0200
From: Gioh Kim <gi-oh.kim@...ud.ionos.com>
To: danil.kipnis@...ud.ionos.com, jinpu.wang@...ud.ionos.com
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
Gioh Kim <gi-oh.kim@...ud.ionos.com>
Subject: [PATCH] block/rnbd: send_msg_close if any error occurs after send_msg_open
From: Gioh Kim <gi-oh.kim@...ud.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@...ud.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 cc6a4e2587ae..4a24603d5224 100644
--- a/drivers/block/rnbd/rnbd-clt.c
+++ b/drivers/block/rnbd/rnbd-clt.c
@@ -1520,7 +1520,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,
@@ -1539,6 +1539,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.20.1
Powered by blists - more mailing lists