Commit 91459140 authored by Changpeng Liu's avatar Changpeng Liu Committed by Tomasz Zawadzki
Browse files

vhost: fix double unlock when stopping device



`stop_device` will release the lock before exiting, the comment
doesn't reflect the code.

Fixes: 376c25ed ("lib/vhost: use user_dev's lock to protect vhost sessions").

Change-Id: I199a019db2ccc57c089d8260bfd5978f051779c6
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20038


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
parent 6cc57905
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1463,10 +1463,8 @@ extern_vhost_pre_msg_handler(int vid, void *_msg)
		pthread_mutex_lock(&user_dev->lock);
		if (vsession->started) {
			pthread_mutex_unlock(&user_dev->lock);
			/* `stop_device` is running in synchronous, it
			 * will hold this lock again before exiting.
			 */
			g_spdk_vhost_ops.destroy_device(vid);
			break;
		}
		pthread_mutex_unlock(&user_dev->lock);
		break;