Skip to content

Commit 9d7c0c9

Browse files
committed
zbd/091: Test F2FS REQ_FUA support for zoned block devices
1 parent 2530e14 commit 9d7c0c9

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed

tests/zbd/091

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: GPL-3.0+
3+
# Copyright (C) 2022 Google LLC
4+
5+
. tests/zbd/rc
6+
. common/null_blk
7+
. common/scsi_debug
8+
9+
DESCRIPTION="test F2FS REQ_FUA support for zoned block devices"
10+
QUICK=1
11+
12+
requires() {
13+
_have_fio
14+
_have_driver f2fs
15+
_have_module null_blk
16+
_have_program mkfs.f2fs
17+
}
18+
19+
test() {
20+
echo "Running ${TEST_NAME}"
21+
22+
local mount_dir="$TMPDIR/mnt"
23+
24+
_init_null_blk nr_devices=0 queue_mode=2 &&
25+
local null_blk_params=(
26+
blocksize=4096
27+
completion_nsec=0
28+
memory_backed=1
29+
size=1024 # MB
30+
submit_queues=1
31+
power=1
32+
) &&
33+
_configure_null_blk nullb0 "${null_blk_params[@]}" &&
34+
local cdev=/dev/nullb0 &&
35+
local null_blk_params=(
36+
blocksize=4096
37+
completion_nsec=0
38+
memory_backed=1
39+
size=1024 # MB
40+
submit_queues=1
41+
zoned=1
42+
zone_size=4 # MB
43+
power=1
44+
) &&
45+
_configure_null_blk nullb1 "${null_blk_params[@]}" &&
46+
echo mq-deadline >/sys/class/block/nullb1/queue/scheduler &&
47+
local zdev=/dev/nullb1 &&
48+
ls -ld "${cdev}" "${zdev}" >>"${FULL}" 2>&1 &&
49+
mkfs.f2fs -m "${cdev}" -c "${zdev}" >>"${FULL}" 2>&1 &&
50+
mkdir -p "${mount_dir}" &&
51+
mount -t f2fs "${cdev}" "${mount_dir}" &&
52+
{ echo 0x3f > "/sys/fs/f2fs/${cdev#/dev/}/data_io_flag"; } >> "${FULL}" 2>&1 && # REQ_META | REQ_FUA
53+
grep -aH . "/sys/fs/f2fs/${cdev#/dev/}/data_io_flag" >>"${FULL}" 2>&1 &&
54+
local fio_args=(
55+
--directory="${mount_dir}"
56+
--group_reporting=1
57+
--gtod_reduce=1
58+
--ioengine=io_uring
59+
--norandommap
60+
--name=f2fs-fua
61+
--numjob=4
62+
--runtime=30
63+
--rw=randwrite
64+
--size=4M
65+
--thread
66+
--time_based
67+
) &&
68+
_run_fio "${fio_args[@]}" >>"${FULL}" 2>&1 ||
69+
fail=true
70+
71+
umount "${mount_dir}" >>"${FULL}" 2>&1
72+
_exit_scsi_debug
73+
_exit_null_blk
74+
75+
if [ -z "$fail" ]; then
76+
echo "Test complete"
77+
else
78+
echo "Test failed"
79+
return 1
80+
fi
81+
}

tests/zbd/091.out

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Running zbd/091
2+
Test complete

0 commit comments

Comments
 (0)