Commit 87019e7d authored by Md Haris Iqbal's avatar Md Haris Iqbal Committed by Jens Axboe

block/rnbd-srv: Protect dev session sysfs removal

Since the removal of the session sysfs can also be called from the
function destroy_sess, there is a need to protect the call from the
function rnbd_srv_sess_dev_force_close

Fixes: 78699805 ("block/rnbd-srv: close a mapped device from server side.")
Signed-off-by: default avatarMd Haris Iqbal <haris.iqbal@cloud.ionos.com>
Reviewed-by: default avatarGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
Signed-off-by: default avatarJack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 46067844
......@@ -338,9 +338,10 @@ static int rnbd_srv_link_ev(struct rtrs_srv *rtrs,
void rnbd_srv_sess_dev_force_close(struct rnbd_srv_sess_dev *sess_dev)
{
mutex_lock(&sess_dev->sess->lock);
rnbd_srv_destroy_dev_session_sysfs(sess_dev);
mutex_unlock(&sess_dev->sess->lock);
sess_dev->keep_id = true;
}
static int process_msg_close(struct rtrs_srv *rtrs,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment