forked from osandov/blktests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zbd/091: Test F2FS REQ_FUA support for zoned block devices
- Loading branch information
1 parent
d45255d
commit 6e83ef2
Showing
2 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/bash | ||
# SPDX-License-Identifier: GPL-3.0+ | ||
# Copyright (C) 2022 Google LLC | ||
|
||
. tests/zbd/rc | ||
. common/null_blk | ||
. common/scsi_debug | ||
|
||
DESCRIPTION="test F2FS REQ_FUA support for zoned block devices" | ||
QUICK=1 | ||
|
||
requires() { | ||
_have_fio | ||
_have_driver f2fs | ||
_have_module null_blk | ||
_have_program mkfs.f2fs | ||
} | ||
|
||
test() { | ||
echo "Running ${TEST_NAME}" | ||
|
||
local mount_dir="$TMPDIR/mnt" | ||
|
||
_init_null_blk nr_devices=0 queue_mode=2 && | ||
local null_blk_params=( | ||
blocksize=4096 | ||
completion_nsec=0 | ||
memory_backed=1 | ||
size=1024 # MB | ||
submit_queues=1 | ||
power=1 | ||
) && | ||
_configure_null_blk nullb0 "${null_blk_params[@]}" && | ||
local cdev=/dev/nullb0 && | ||
local null_blk_params=( | ||
blocksize=4096 | ||
completion_nsec=0 | ||
memory_backed=1 | ||
size=1024 # MB | ||
submit_queues=1 | ||
zoned=1 | ||
zone_size=4 # MB | ||
power=1 | ||
) && | ||
_configure_null_blk nullb1 "${null_blk_params[@]}" && | ||
echo mq-deadline >/sys/class/block/nullb1/queue/scheduler && | ||
local zdev=/dev/nullb1 && | ||
ls -ld "${cdev}" "${zdev}" >>"${FULL}" 2>&1 && | ||
mkfs.f2fs -m "${cdev}" -c "${zdev}" >>"${FULL}" 2>&1 && | ||
mkdir -p "${mount_dir}" && | ||
mount -t f2fs "${cdev}" "${mount_dir}" && | ||
{ echo 0x3f > "/sys/fs/f2fs/${cdev#/dev/}/data_io_flag"; } >> "${FULL}" 2>&1 && # REQ_META | REQ_FUA | ||
grep -aH . "/sys/fs/f2fs/${cdev#/dev/}/data_io_flag" >>"${FULL}" 2>&1 && | ||
local fio_args=( | ||
--directory="${mount_dir}" | ||
--group_reporting=1 | ||
--gtod_reduce=1 | ||
--ioengine=io_uring | ||
--norandommap | ||
--name=f2fs-fua | ||
--numjob=4 | ||
--runtime=30 | ||
--rw=randwrite | ||
--size=4M | ||
--thread | ||
--time_based | ||
) && | ||
_run_fio "${fio_args[@]}" >>"${FULL}" 2>&1 || | ||
fail=true | ||
|
||
umount "${mount_dir}" >>"${FULL}" 2>&1 | ||
_exit_scsi_debug | ||
_exit_null_blk | ||
|
||
if [ -z "$fail" ]; then | ||
echo "Test complete" | ||
else | ||
echo "Test failed" | ||
return 1 | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Running zbd/091 | ||
Test complete |