From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: fio@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Cc: Damien Le Moal <Damien.LeMoal@wdc.com>,
Hans Holmberg <hans.holmberg@wdc.com>,
Aravind Ramesh <aravind.ramesh@wdc.com>,
Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Subject: [PATCH v2 5/6] t/zbd: Support testing zone capacity smaller than zone size with null_blk
Date: Wed, 15 Jul 2020 15:41:40 +0900 [thread overview]
Message-ID: <20200715064141.116415-6-shinichiro.kawasaki@wdc.com> (raw)
In-Reply-To: <20200715064141.116415-1-shinichiro.kawasaki@wdc.com>
To test zone capacity support by fio using null_blk, add -zone-cap option
to run-tests-against-zoned-nullb. With this option, the script creates a
null_blk device which has zone capacity smaller than zone size and run
test-zbd-support script for the device.
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
t/zbd/run-tests-against-zoned-nullb | 30 ++++++++++++++++++++++++++---
1 file changed, 27 insertions(+), 3 deletions(-)
diff --git a/t/zbd/run-tests-against-zoned-nullb b/t/zbd/run-tests-against-zoned-nullb
index 53aee3e8..9a5d5409 100755
--- a/t/zbd/run-tests-against-zoned-nullb
+++ b/t/zbd/run-tests-against-zoned-nullb
@@ -6,6 +6,21 @@
scriptdir="$(cd "$(dirname "$0")" && pwd)"
+zone_size=1
+zone_capacity=1
+if [[ ${1} == "-h" ]]; then
+ echo "Usage: ${0} [OPTIONS]"
+ echo "Options:"
+ echo -e "\t-h Show this message."
+ echo -e "\t-zone-cap Use null blk with zone capacity less than zone size."
+ echo -e "\tany option supported by test-zbd-support script"
+ exit 1
+elif [[ ${1} == "-zone-cap" ]]; then
+ zone_size=4
+ zone_capacity=3
+ shift
+fi
+
for d in /sys/kernel/config/nullb/*; do [ -d "$d" ] && rmdir "$d"; done
modprobe -r null_blk
modprobe null_blk nr_devices=0 || exit $?
@@ -17,9 +32,18 @@ modprobe -r null_blk
modprobe null_blk nr_devices=0 &&
cd /sys/kernel/config/nullb &&
mkdir nullb0 &&
- cd nullb0 &&
- echo 1 > zoned &&
- echo 1 > zone_size &&
+ cd nullb0 || exit $?
+
+if ((zone_capacity < zone_size)); then
+ if [[ ! -w zone_capacity ]]; then
+ echo "null blk does not support zone capacity"
+ exit 1
+ fi
+ echo "${zone_capacity}" > zone_capacity
+fi
+
+echo 1 > zoned &&
+ echo "${zone_size}" > zone_size &&
echo 0 > completion_nsec &&
echo 4096 > blocksize &&
echo 1024 > size &&
--
2.26.2
next prev parent reply other threads:[~2020-07-15 6:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-15 6:41 [PATCH v2 0/6] Support zone capacity Shin'ichiro Kawasaki
2020-07-15 6:41 ` [PATCH v2 1/6] zbd: Support zone capacity smaller than zone size Shin'ichiro Kawasaki
2020-07-17 1:44 ` Damien Le Moal
2020-07-15 6:41 ` [PATCH v2 2/6] options: Add zonecapacity option for zonemode=zbd Shin'ichiro Kawasaki
2020-07-17 1:48 ` Damien Le Moal
2020-07-15 6:41 ` [PATCH v2 3/6] t/zbd: Mandate blkzone capacity report for devices with zone capacity Shin'ichiro Kawasaki
2020-07-17 1:58 ` Damien Le Moal
2020-07-15 6:41 ` [PATCH v2 4/6] t/zbd: Support testing zone capacity smaller than zone size Shin'ichiro Kawasaki
2020-07-17 2:01 ` Damien Le Moal
2020-07-17 6:59 ` Shinichiro Kawasaki
2020-07-17 7:01 ` Damien Le Moal
2020-07-15 6:41 ` Shin'ichiro Kawasaki [this message]
2020-07-17 2:06 ` [PATCH v2 5/6] t/zbd: Support testing zone capacity smaller than zone size with null_blk Damien Le Moal
2020-07-15 6:41 ` [PATCH v2 6/6] t/zbd: Add test case to check zonecapacity option Shin'ichiro Kawasaki
2020-07-17 2:07 ` Damien Le Moal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200715064141.116415-6-shinichiro.kawasaki@wdc.com \
--to=shinichiro.kawasaki@wdc.com \
--cc=Damien.LeMoal@wdc.com \
--cc=aravind.ramesh@wdc.com \
--cc=axboe@kernel.dk \
--cc=fio@vger.kernel.org \
--cc=hans.holmberg@wdc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.