Commit 486651f7 authored by Mike Gerdts's avatar Mike Gerdts Committed by Tomasz Zawadzki
Browse files

test/vhost: close bdev before claim for lvs



The original implementation of bdev claims allows a module to establish
an exclusive writer claim on a bdev that has other descriptors open for
writing. This is arguably a bug. With claims v2, this bug does not
exist. The conversion of spdk_bs_bdev_claim() to claims v2 exposes this
bug in the vhost_negative test.

This patch removes an extraneous vhost_scsi_controller_add_target RPC
call that left Malloc0 open read-write while bdev_lvol_create_lvstore
tries to create an lvstore on Malloc0.

Signed-off-by: default avatarMike Gerdts <mgerdts@nvidia.com>
Change-Id: I963e210e1bc033d8720e240760004ed8aef7fda3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16169


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
parent 86bbcdb8
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
#  SPDX-License-Identifier: BSD-3-Clause
#  Copyright (C) 2017 Intel Corporation
#  All rights reserved.
#  Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
@@ -171,9 +172,6 @@ if $rpc_py vhost_scsi_controller_remove_target naa.0 8 > /dev/null; then
	error "Removing device 8 from controller naa.0 succeeded, but it shouldn't"
fi

notice "Re-adding device 0 to naa.0"
$rpc_py vhost_scsi_controller_add_target naa.0 0 Malloc0

# BLK
notice "Trying to create block controller with incorrect cpumask outside of application cpumask"
if $rpc_py vhost_create_blk_controller vhost.invalid.cpumask Malloc0 --cpumask 0xf0; then