]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
common/xfs: propagate errors from _xfs_run_fio_verify_io
authorDaniel Wagner <dwagner@suse.de>
Tue, 26 Mar 2024 13:13:46 +0000 (14:13 +0100)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fri, 29 Mar 2024 05:36:25 +0000 (14:36 +0900)
If _xfs_mkfs_and_mount fails _xfs_run_fio_verify_io will continue to
execute and fio will run against the local file system instead against
the block device.

Propagate all errors back to the caller.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
common/xfs

index 37ce85878df24ee562ab2a96b363027edbdf039c..569770fecd53bcfb70baddd28e578a91d8ce5c73 100644 (file)
@@ -16,7 +16,7 @@ _xfs_mkfs_and_mount() {
 
        mkdir -p "${mount_dir}"
        umount "${mount_dir}"
-       mkfs.xfs -l size=64m -f "${bdev}"
+       mkfs.xfs -l size=64m -f "${bdev}" || return $?
        mount "${bdev}" "${mount_dir}"
 }
 
@@ -27,8 +27,10 @@ _xfs_run_fio_verify_io() {
        local sz_mb
        local avail
        local avail_mb
+       local rc
 
-       _xfs_mkfs_and_mount "${bdev}" "${mount_dir}" >> "${FULL}" 2>&1
+       _xfs_mkfs_and_mount "${bdev}" "${mount_dir}" \
+               >>"${FULL}" 2>&1 || return $?
 
        avail="$(df --output=avail "${mount_dir}" | tail -1)"
        avail_mb="$((avail / 1024))"
@@ -43,7 +45,10 @@ _xfs_run_fio_verify_io() {
        fi
 
        _run_fio_verify_io --size="${sz_mb}m" --directory="${mount_dir}/"
+       rc=$?
 
        umount "${mount_dir}" >> "${FULL}" 2>&1
        rm -fr "${mount_dir}"
+
+       return "${rc}"
 }