Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96d97e17 authored by Josef Bacik's avatar Josef Bacik Committed by Jens Axboe
Browse files

nbd: clear_sock on netlink disconnect



This is what the ioctl based nbd disconnect does as well.  Without this
the device will just sit there and wait for the connection to go away
(or IO to occur) before the device gets torn down.  Instead clear
everything up on our end so the configuration goes away as quickly as
possible.

Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 9e2b1967
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1768,6 +1768,7 @@ static int nbd_genl_disconnect(struct sk_buff *skb, struct genl_info *info)
	}
	}
	mutex_lock(&nbd->config_lock);
	mutex_lock(&nbd->config_lock);
	nbd_disconnect(nbd);
	nbd_disconnect(nbd);
	nbd_clear_sock(nbd);
	mutex_unlock(&nbd->config_lock);
	mutex_unlock(&nbd->config_lock);
	if (test_and_clear_bit(NBD_HAS_CONFIG_REF,
	if (test_and_clear_bit(NBD_HAS_CONFIG_REF,
			       &nbd->config->runtime_flags))
			       &nbd->config->runtime_flags))