diff --git a/test/bdev/blockdev.sh b/test/bdev/blockdev.sh index 0f8e56e41..43f1ab445 100755 --- a/test/bdev/blockdev.sh +++ b/test/bdev/blockdev.sh @@ -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 diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 71eb83e5e..d3338b91e 100644 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -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