Unverified Commit f18dd64c authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 0d41232e 0d0f7abd
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1417,13 +1417,18 @@ static int nbd_start_device_ioctl(struct nbd_device *nbd)
	mutex_unlock(&nbd->config_lock);
	ret = wait_event_interruptible(config->recv_wq,
					 atomic_read(&config->recv_threads) == 0);

	/*
	 * recv_work in flush_workqueue will not get this lock, because nbd_open
	 * will hold nbd->config_refs
	 */
	mutex_lock(&nbd->config_lock);
	if (ret) {
		sock_shutdown(nbd);
		nbd_clear_que(nbd);
	}

	flush_workqueue(nbd->recv_workq);
	mutex_lock(&nbd->config_lock);
	nbd_bdev_reset(nbd);
	/* user requested, ignore socket errors */
	if (test_bit(NBD_RT_DISCONNECT_REQUESTED, &config->runtime_flags))