From 486651f7902b8301c4098cc5f22bbdc847b77d5e Mon Sep 17 00:00:00 2001 From: Mike Gerdts Date: Thu, 5 Jan 2023 14:33:41 -0600 Subject: [PATCH] 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: Mike Gerdts Change-Id: I963e210e1bc033d8720e240760004ed8aef7fda3 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16169 Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins Reviewed-by: Aleksey Marchuk Reviewed-by: Shuhei Matsumoto --- test/vhost/other/negative.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/vhost/other/negative.sh b/test/vhost/other/negative.sh index ced80fa36..e40627e22 100755 --- a/test/vhost/other/negative.sh +++ b/test/vhost/other/negative.sh @@ -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