Commit eea06cfd authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

test/setup: Acquire lock while partitioning target block device



Follow 0e13e309. As we are at it, fix a nasty typo.

Fixes issue: 3232

Change-Id: If698d8f5d48aa9aa84a904eb41d0b76732a28657
Signed-off-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21452


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 1feedcab
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ function nvmf_filesystem_part() {
		run_test "filesystem_in_capsule_xfs" nvmf_filesystem_create "xfs" ${nvme_name}
	fi

	# Make sure the target block device is not hold by udev-worker when we attempt to
	# Make sure the target block device is not held by udev-worker when we attempt to
	# remove the partition - the removal here forces parted to send BLKRRPART which may
	# fail in case the device is already locked. By acquiring a lock of our own we make
	# sure to either block until device is available or make the udev-worker to back off.
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ partition_drive() {
	for ((part = 1; part <= part_no; part++)); do
		((part_start = part_start == 0 ? 2048 : part_end + 1))
		((part_end = part_start + size - 1))
		sgdisk "/dev/$disk" --new="$part:$part_start:$part_end"
		flock "/dev/$disk" sgdisk "/dev/$disk" --new="$part:$part_start:$part_end"
	done
	wait "$!"
}