Commit 3fbc84d3 authored by GangCao's avatar GangCao Committed by Jim Harris
Browse files

fio/bdev: fix the AIO bdev intermittent IO failure

This is to solve below github issue:
https://github.com/spdk/spdk/issues/935



Change-Id: I9b90f58c2756a415916d54ea49e62dbb467db4a0
Signed-off-by: default avatarGangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471428


Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent c8b6a884
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ if [ -d /usr/src/fio ]; then

	timing_enter fio_rw_verify
	# Generate the fio config file given the list of all unclaimed bdevs
	fio_config_gen $testdir/bdev.fio verify
	fio_config_gen $testdir/bdev.fio verify AIO
	for b in $(echo $bdevs | jq -r '.name'); do
		fio_config_add_job $testdir/bdev.fio $b
	done
+11 −0
Original line number Diff line number Diff line
@@ -727,6 +727,8 @@ function fio_config_gen()
{
	local config_file=$1
	local workload=$2
	local bdev_type=$3
	local fio_dir="/usr/src/fio"

	if [ -e "$config_file" ]; then
		echo "Configuration File Already Exists!: $config_file"
@@ -754,6 +756,15 @@ EOL
		echo "verify=sha1" >> $config_file
		echo "verify_backlog=1024" >> $config_file
		echo "rw=randwrite" >> $config_file

		# To avoid potential data race issue due to the AIO device
		# flush mechanism, add the flag to serialize the writes.
		# This is to fix the intermittent IO failure issue of #935
		if [ "$bdev_type" == "AIO" ]; then
			if [[ $($fio_dir/fio --version) == *"fio-3"* ]]; then
				echo "serialize_overlap=1" >> $config_file
			fi
		fi
	elif [ "$workload" == "trim" ]; then
		echo "rw=trimwrite" >> $config_file
	else