[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230511140953.17609-4-dwagner@suse.de>
Date: Thu, 11 May 2023 16:09:45 +0200
From: Daniel Wagner <dwagner@...e.de>
To: linux-nvme@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
Chaitanya Kulkarni <kch@...dia.com>,
Shin'ichiro Kawasaki <shinichiro@...tmail.com>,
Hannes Reinecke <hare@...e.de>, Daniel Wagner <dwagner@...e.de>
Subject: [PATCH blktests v4 03/11] common/xfs: Make size argument optional for _xfs_run_fio_verify_io
Make the size argument optional by reading the filesystem info. The
caller doesn't have to guess (or calculate) how big the max IO size.
The log data structure of XFS is reducing the capacity.
Reviewed-by: Chaitanya Kulkarni <kch@...dia.com>
Signed-off-by: Daniel Wagner <dwagner@...e.de>
---
common/xfs | 14 +++++++++++++-
tests/nvme/012 | 2 +-
tests/nvme/013 | 2 +-
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/common/xfs b/common/xfs
index 2c5d96164ac1..413c2820ffaf 100644
--- a/common/xfs
+++ b/common/xfs
@@ -24,10 +24,22 @@ _xfs_run_fio_verify_io() {
local mount_dir="/mnt/blktests"
local bdev=$1
local sz=$2
+ local sz_mb
+ local avail
+ local avail_mb
_xfs_mkfs_and_mount "${bdev}" "${mount_dir}" >> "${FULL}" 2>&1
- _run_fio_verify_io --size="$sz" --directory="${mount_dir}/"
+ avail="$(df --output=avail "${mount_dir}" | tail -1)"
+ avail_mb="$((avail / 1024))"
+
+ if [[ -z "${sz}" ]]; then
+ sz_mb="${avail_mb}"
+ else
+ sz_mb="$(convert_to_mb "${sz}")"
+ fi
+
+ _run_fio_verify_io --size="${sz_mb}m" --directory="${mount_dir}/"
umount "${mount_dir}" >> "${FULL}" 2>&1
rm -fr "${mount_dir}"
diff --git a/tests/nvme/012 b/tests/nvme/012
index e60082c2e751..c9d24388306d 100755
--- a/tests/nvme/012
+++ b/tests/nvme/012
@@ -44,7 +44,7 @@ test() {
cat "/sys/block/${nvmedev}n1/uuid"
cat "/sys/block/${nvmedev}n1/wwid"
- _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m"
+ _xfs_run_fio_verify_io "/dev/${nvmedev}n1"
_nvme_disconnect_subsys "${subsys_name}"
diff --git a/tests/nvme/013 b/tests/nvme/013
index 9d60a7df4577..265b6968fd34 100755
--- a/tests/nvme/013
+++ b/tests/nvme/013
@@ -41,7 +41,7 @@ test() {
cat "/sys/block/${nvmedev}n1/uuid"
cat "/sys/block/${nvmedev}n1/wwid"
- _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m"
+ _xfs_run_fio_verify_io "/dev/${nvmedev}n1"
_nvme_disconnect_subsys "${subsys_name}"
--
2.40.0
Powered by blists - more mailing lists