Skip to content

Commit

Permalink
zbd/091: Test F2FS REQ_FUA support for zoned block devices
Browse files Browse the repository at this point in the history
  • Loading branch information
bvanassche committed Jun 6, 2024
1 parent d45255d commit 6e83ef2
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
81 changes: 81 additions & 0 deletions tests/zbd/091
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
}
2 changes: 2 additions & 0 deletions tests/zbd/091.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Running zbd/091
Test complete

0 comments on commit 6e83ef2

Please sign in to comment.