]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
common/xfs: Limit fio size job to fit into xfs fs
authorDaniel Wagner <dwagner@suse.de>
Thu, 11 May 2023 14:09:46 +0000 (16:09 +0200)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Thu, 25 May 2023 23:45:18 +0000 (08:45 +0900)
The usable capacity of the filesystem is less than the raw
partition/device size due to the additional meta/log data.

Ensure that the job size for fio is not exceeding the limits.

Because we have hard coded the path where we mount the filesystem
and don't want to expose this, we just update max size inside
_xfs_run_fio_verify_io(). No need to leak this into the caller.

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

index 413c2820ffaf32b850958bd162ee3834b9f38dff..37ce85878df24ee562ab2a96b363027edbdf039c 100644 (file)
@@ -37,6 +37,9 @@ _xfs_run_fio_verify_io() {
                sz_mb="${avail_mb}"
        else
                sz_mb="$(convert_to_mb "${sz}")"
+               if [[ "${sz_mb}" -gt "${avail_mb}" ]]; then
+                       sz_mb="${avail_mb}"
+               fi
        fi
 
        _run_fio_verify_io --size="${sz_mb}m" --directory="${mount_dir}/"