Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package blktests for openSUSE:Factory checked in at 2025-07-30 11:45:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/blktests (Old) and /work/SRC/openSUSE:Factory/.blktests.new.13279 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "blktests" Wed Jul 30 11:45:43 2025 rev:11 rq:1296378 version:0+20250718.d24f744 Changes: -------- --- /work/SRC/openSUSE:Factory/blktests/blktests.changes 2025-04-24 17:25:49.426115500 +0200 +++ /work/SRC/openSUSE:Factory/.blktests.new.13279/blktests.changes 2025-07-30 11:46:51.654406562 +0200 @@ -1,0 +2,34 @@ +Tue Jul 29 16:49:41 UTC 2025 - sebastian.ch...@suse.com + +- Update to version 0+20250718.d24f744: + * common/null_blk: wait device ready in _configure_null_blk + * loop/010, common/rc: drain udev events after test + * md/002: add atomic write tests for md/stacked devices + * common/null_blk: check FULL file availability before write + * block: add block/040 for test updating nr_hw_queues vs switching elevator + * nvme/049: add fio md_per_io_size option + * nvme/{034,035}: skip when the test target namespace has metadata + * nvme/064: fix failure when the sysfs metadata_bytes doesn't exist + * tests/throtl: add a new test 007 + * nvme: add nvme metadata passthrough test + * nvme/rc: introduce helper functions to check namespace metadata + * loop/011: use lazy umount for tmpfs + * check: allow strict error-checking by "set -e" in test cases + * common/rc: Optimize _module_file_exists() + * common/null_blk: Make configuration failures easier to debug + * common/null_blk: Log null_blk configuration parameters + * common/null_blk: Rename a local variable + * common/fio: Optimize _fio_perf_report() + * common/fio: Log the fio arguments + * common/nvme: fix nvme json support check in _have_nvme_cli_with_json_support + * common/scsi_debug: Use _unload_module in _exit_scsi_debug + * nvme/rc, md/001: check that nvme-cli supports json output format + * common/nvme: introduce _have_nvme_cli_with_json_support() + * zbd/006: reset only the test target zone + * README, CONTRIBUTING: refer to the new repository addresses + * nvme/063: fixup tls_key encryption check + * nvme/054: update to support all fabrics + * nvme/rc: fix the skip reasons in _require_nvme_cli_tls + * block: add test for race between set_blocksize and read paths + +------------------------------------------------------------------- Old: ---- blktests-0+20250415.9aa2023.tar.xz New: ---- blktests-0+20250718.d24f744.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ blktests.spec ++++++ --- /var/tmp/diff_new_pack.QCPTk7/_old 2025-07-30 11:46:52.382436679 +0200 +++ /var/tmp/diff_new_pack.QCPTk7/_new 2025-07-30 11:46:52.382436679 +0200 @@ -17,7 +17,7 @@ Name: blktests -Version: 0+20250415.9aa2023 +Version: 0+20250718.d24f744 Release: 0 Summary: Linux kernel block layer testing framework License: GPL-2.0-or-later ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.QCPTk7/_old 2025-07-30 11:46:52.422438334 +0200 +++ /var/tmp/diff_new_pack.QCPTk7/_new 2025-07-30 11:46:52.422438334 +0200 @@ -3,6 +3,6 @@ <param name="url">git://github.com/osandov/blktests</param> <param name="changesrevision">e10add032819db8f3abf0a9d53f160b7b10cfed8</param></service><service name="tar_scm"> <param name="url">https://github.com/osandov/blktests.git</param> - <param name="changesrevision">9aa2023312bfcdd6b31c24b6e4a4a5c2d4f870d2</param></service></servicedata> + <param name="changesrevision">d24f7445c5758cd7acacd8edf315aafdf6f41689</param></service></servicedata> (No newline at EOF) ++++++ blktests-0+20250415.9aa2023.tar.xz -> blktests-0+20250718.d24f744.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/CONTRIBUTING.md new/blktests-0+20250718.d24f744/CONTRIBUTING.md --- old/blktests-0+20250415.9aa2023/CONTRIBUTING.md 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/CONTRIBUTING.md 2025-07-18 14:01:02.000000000 +0200 @@ -3,7 +3,7 @@ You can contribute to blktests by sending patches to the <linux-bl...@vger.kernel.org> mailing list and Shin'ichiro Kawasaki <shinichiro.kawas...@wdc.com> or by opening a pull request to the [blktests GitHub -repository](https://github.com/osandov/blktests). Patch post is more recommended +repository](https://github.com/linux-blktests/blktests). Patch post is more recommended since it will be visible to more kernel developers and easier to gather feedback. If sending patches, please generate the patch with `git format-patch --subject-prefix="PATCH blktests"`. Consider configuring git to do this for you diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/README.md new/blktests-0+20250718.d24f744/README.md --- old/blktests-0+20250415.9aa2023/README.md 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/README.md 2025-07-18 14:01:02.000000000 +0200 @@ -1,6 +1,6 @@ # blktests -[](https://github.com/osandov/blktests/actions) +[](https://github.com/linux-blktests/blktests/actions) blktests is a test framework for the Linux kernel block layer and storage stack. It is inspired by the [xfstests](https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/check new/blktests-0+20250718.d24f744/check --- old/blktests-0+20250415.9aa2023/check 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/check 2025-07-18 14:01:02.000000000 +0200 @@ -502,9 +502,10 @@ fi fi RESULTS_DIR="$OUTPUT/$(basename "$TEST_DEV")""$postfix" - if ! _call_test test_device; then - ret=1 - fi + # Avoid "if" and "!" for errexit in test cases + _call_test test_device + # shellcheck disable=SC2181 + (($? != 0)) && ret=1 if (( unset_skip_reason )); then unset SKIP_REASONS fi @@ -637,9 +638,10 @@ local ret=0 local test_name for test_name in "${tests[@]}"; do - if ! ( _run_test "$test_name" ); then - ret=1 - fi + # Avoid "if" and "!" for errexit in test cases + ( _run_test "$test_name" ) + # shellcheck disable=SC2181 + (($? != 0)) && ret=1 done return $ret } @@ -695,9 +697,10 @@ if [[ $group != "$prev_group" ]]; then prev_group="$group" if [[ ${#tests[@]} -gt 0 ]]; then - if ! ( _run_group "${tests[@]}" ); then - ret=1 - fi + # Avoid "if" and "!" for errexit in test cases + ( _run_group "${tests[@]}" ) + # shellcheck disable=SC2181 + (($? != 0)) && ret=1 tests=() fi fi @@ -705,9 +708,10 @@ done < <(_find_tests "$@" | sort -zu) if [[ ${#tests[@]} -gt 0 ]]; then - if ! ( _run_group "${tests[@]}" ); then - ret=1 - fi + # Avoid "if" and "!" for errexit in test cases + ( _run_group "${tests[@]}" ) + # shellcheck disable=SC2181 + (($? != 0)) && ret=1 fi return $ret diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/common/fio new/blktests-0+20250718.d24f744/common/fio --- old/blktests-0+20250415.9aa2023/common/fio 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/common/fio 2025-07-18 14:01:02.000000000 +0200 @@ -177,6 +177,7 @@ args+=("--runtime=$TIMEOUT") fi + echo "fio ${args[*]} $*" >>"$FULL" fio "${args[@]}" "$@" local rc=$? if [ $rc != 0 ]; then @@ -219,20 +220,23 @@ } _fio_perf_report() { - # If there is more than one group, we don't know what to report. - if [[ $(wc -l < "$TMPDIR/fio_perf") -gt 1 ]]; then - echo "_fio_perf: too many terse lines" >&2 - return - fi + local name field value_array + { + IFS=';' read -ra value_array + + # If there is more than one group, we don't know what to report. + if read -r; then + echo "_fio_perf: too many terse lines" >&2 + return + fi + } <"$TMPDIR/fio_perf" - local name field value for name in "${FIO_PERF_FIELDS[@]}"; do field="${FIO_TERSE_FIELDS["$name"]}" if [[ -z $field ]]; then echo "_fio_perf: unknown fio terse field '$name'" >&2 continue fi - value="$(cut -d ';' -f "$field" "$TMPDIR/fio_perf")" - TEST_RUN["$FIO_PERF_PREFIX$name"]="$value" + TEST_RUN["$FIO_PERF_PREFIX$name"]=${value_array[$((field - 1))]} done } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/common/null_blk new/blktests-0+20250718.d24f744/common/null_blk --- old/blktests-0+20250415.9aa2023/common/null_blk 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/common/null_blk 2025-07-18 14:01:02.000000000 +0200 @@ -49,25 +49,31 @@ # Configure one null_blk instance with name $1 and parameters $2..${$#}. _configure_null_blk() { - local nullb=/sys/kernel/config/nullb/$1 param val + local nullb_path=/sys/kernel/config/nullb/$1 params param shift if [[ ! -d /sys/module/null_blk ]]; then modprobe -q null_blk fi - mkdir "$nullb" || return $? + mkdir "$nullb_path" || return $? + params=() if (( RUN_FOR_ZONED )); then - echo "1" > "$nullb/zoned" || return 1 + params+=(zoned=1) fi + params+=("$@") - while [[ $# -gt 0 ]]; do - param="${1%%=*}" - val="${1#*=}" - shift - echo "$val" > "$nullb/$param" || return 1 + [[ -n "${FULL}" ]] && echo "$nullb_path ${params[*]}" >>"${FULL}" + + for param in "${params[@]}"; do + local key="${param%%=*}" val="${param#*=}" + if ! echo "$val" > "$nullb_path/$key"; then + echo "Writing $val into $nullb_path/$key failed" + return 1 + fi done + udevadm settle } _exit_null_blk() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/common/nvme new/blktests-0+20250718.d24f744/common/nvme --- old/blktests-0+20250415.9aa2023/common/nvme 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/common/nvme 2025-07-18 14:01:02.000000000 +0200 @@ -62,6 +62,16 @@ return 0 } +_have_nvme_cli_with_json_support() { + _have_program nvme || return $? + + if ! nvme list --help 2>&1 | grep -q json; then + SKIP_REASONS+=("nvme-cli does not support json output format") + return 1 + fi + return 0 +} + _nvme_fcloop_add_rport() { local local_wwnn="$1" local local_wwpn="$2" @@ -415,7 +425,7 @@ if [[ ${concat} = true ]]; then ARGS+=(--concat) fi - ARGS+=(-o json) + ARGS+=(--output-format=json) connect=$(nvme connect "${ARGS[@]}" 2> /dev/null) # Wait until device file and sysfs attributes get ready diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/common/rc new/blktests-0+20250718.d24f744/common/rc --- old/blktests-0+20250415.9aa2023/common/rc 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/common/rc 2025-07-18 14:01:02.000000000 +0200 @@ -37,14 +37,13 @@ local ko_underscore=${1//-/_}.ko local ko_hyphen=${1//_/-}.ko local libpath - local -i count libpath="/lib/modules/$(uname -r)/kernel" [[ ! -d $libpath ]] && return 1 - count=$(find "$libpath" -name "$ko_underscore*" -o \ - -name "$ko_hyphen*" | wc -l) - ((count)) && return 0 - return 1 + local module_path + module_path="$(find "$libpath" -name "$ko_underscore*" -o \ + -name "$ko_hyphen*")" + [ -n "${module_path}" ] } # Check that the specified module or driver is available, regardless of whether @@ -545,6 +544,15 @@ done } +_drain_udev_events() { + if command -v systemctl &>/dev/null && + systemctl is-active --quiet systemd-udevd; then + systemctl restart systemd-udevd.service + else + udevadm settle --timeout=900 + fi +} + # Run the given command as NORMAL_USER _run_user() { su "$NORMAL_USER" -c "$1" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/common/scsi_debug new/blktests-0+20250718.d24f744/common/scsi_debug --- old/blktests-0+20250415.9aa2023/common/scsi_debug 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/common/scsi_debug 2025-07-18 14:01:02.000000000 +0200 @@ -180,7 +180,7 @@ udevadm settle if _module_file_exists scsi_debug; then - modprobe -r scsi_debug + _unload_module scsi_debug 10 return fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/src/Makefile new/blktests-0+20250718.d24f744/src/Makefile --- old/blktests-0+20250415.9aa2023/src/Makefile 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/src/Makefile 2025-07-18 14:01:02.000000000 +0200 @@ -13,6 +13,7 @@ loop_change_fd \ loop_get_status_null \ mount_clear_sock \ + nvme-passthrough-meta \ nbdsetsize \ openclose \ sg/dxfer-from-dev \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/src/nvme-passthrough-meta.c new/blktests-0+20250718.d24f744/src/nvme-passthrough-meta.c --- old/blktests-0+20250415.9aa2023/src/nvme-passthrough-meta.c 1970-01-01 01:00:00.000000000 +0100 +++ new/blktests-0+20250718.d24f744/src/nvme-passthrough-meta.c 2025-07-18 14:01:02.000000000 +0200 @@ -0,0 +1,232 @@ +// SPDX-License-Identifier: GPL-3.0+ +// Copyright (C) 2025 Keith Busch + +/* + * Simple test exercising the user metadata interfaces used by nvme passthrough + * commands. + */ +#define _GNU_SOURCE +#include <dirent.h> +#include <errno.h> +#include <fcntl.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include <inttypes.h> +#include <sys/ioctl.h> +#include <sys/mman.h> +#include <linux/types.h> + +#ifndef _LINUX_NVME_IOCTL_H +#define _LINUX_NVME_IOCTL_H +struct nvme_passthru_cmd { + __u8 opcode; + __u8 flags; + __u16 rsvd1; + __u32 nsid; + __u32 cdw2; + __u32 cdw3; + __u64 metadata; + __u64 addr; + __u32 metadata_len; + __u32 data_len; + __u32 cdw10; + __u32 cdw11; + __u32 cdw12; + __u32 cdw13; + __u32 cdw14; + __u32 cdw15; + __u32 timeout_ms; + __u32 result; +}; + +#define NVME_IOCTL_ID _IO('N', 0x40) +#define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_passthru_cmd) +#define NVME_IOCTL_IO_CMD _IOWR('N', 0x43, struct nvme_passthru_cmd) +#endif /* _UAPI_LINUX_NVME_IOCTL_H */ + +struct nvme_lbaf { + __le16 ms; + __u8 ds; + __u8 rp; +}; + +struct nvme_id_ns { + __le64 nsze; + __le64 ncap; + __le64 nuse; + __u8 nsfeat; + __u8 nlbaf; + __u8 flbas; + __u8 mc; + __u8 dpc; + __u8 dps; + __u8 nmic; + __u8 rescap; + __u8 fpi; + __u8 dlfeat; + __le16 nawun; + __le16 nawupf; + __le16 nacwu; + __le16 nabsn; + __le16 nabo; + __le16 nabspf; + __le16 noiob; + __u8 nvmcap[16]; + __le16 npwg; + __le16 npwa; + __le16 npdg; + __le16 npda; + __le16 nows; + __u8 rsvd74[18]; + __le32 anagrpid; + __u8 rsvd96[3]; + __u8 nsattr; + __le16 nvmsetid; + __le16 endgid; + __u8 nguid[16]; + __u8 eui64[8]; + struct nvme_lbaf lbaf[64]; + __u8 vs[3712]; +}; + +#define BUFFER_SIZE (32768) + +int main(int argc, char **argv) +{ + int ret, fd, nsid, blocks, meta_buffer_size; + void *buffer, *mptr = NULL, *meta = NULL; + struct nvme_passthru_cmd cmd; + struct nvme_lbaf lbaf; + struct nvme_id_ns ns; + + __u64 block_size; + __u16 meta_size; + + if (argc < 2) { + fprintf(stderr, "usage: %s /dev/nvmeXnY", argv[0]); + return EINVAL; + } + + fd = open(argv[1], O_RDONLY); + if (fd < 0) + return fd; + + nsid = ioctl(fd, NVME_IOCTL_ID); + if (nsid < 0) { + perror("namespace id"); + return errno; + } + + cmd = (struct nvme_passthru_cmd) { + .opcode = 0x6, + .nsid = nsid, + .addr = (__u64)(uintptr_t)&ns, + .data_len = sizeof(ns), + }; + + ret = ioctl(fd, NVME_IOCTL_ADMIN_CMD, &cmd); + if (ret < 0) { + perror("id-ns"); + return errno; + } + + lbaf = ns.lbaf[ns.flbas & 0xf]; + block_size = 1 << lbaf.ds; + meta_size = lbaf.ms; + + /* format not appropriate for this test */ + if (meta_size == 0) { + fprintf(stderr, "Device format does not have metadata\n"); + return -EINVAL; + } + + blocks = BUFFER_SIZE / block_size; + meta_buffer_size = blocks * meta_size; + + buffer = malloc(BUFFER_SIZE); + mptr = mmap(NULL, 8192, PROT_READ | PROT_WRITE, + MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); + if (mptr == MAP_FAILED) { + perror("mmap"); + return errno; + } + + /* this should directly use the user space buffer */ + meta = mptr; + cmd = (struct nvme_passthru_cmd) { + .opcode = 1, + .nsid = nsid, + .addr = (uintptr_t)buffer, + .metadata = (uintptr_t)meta, + .data_len = BUFFER_SIZE, + .metadata_len = meta_buffer_size, + .cdw12 = blocks - 1, + }; + + ret = ioctl(fd, NVME_IOCTL_IO_CMD, &cmd); + if (ret < 0) { + perror("nvme-write"); + return ret; + } + + cmd.opcode = 2; + ret = ioctl(fd, NVME_IOCTL_IO_CMD, &cmd); + if (ret < 0) { + perror("nvme-read"); + return ret; + } + + /* + * this offset should either force a kernel copy if we don't have + * contiguous pages, or test the device's metadata sgls + */ + meta = mptr + 4096 - 16; + cmd.opcode = 1; + cmd.metadata = (uintptr_t)meta; + + ret = ioctl(fd, NVME_IOCTL_IO_CMD, &cmd); + if (ret < 0) { + perror("nvme-write (offset)"); + return errno; + } + + cmd.opcode = 2; + ret = ioctl(fd, NVME_IOCTL_IO_CMD, &cmd); + if (ret < 0) { + perror("nvme-read (offset)"); + return errno; + } + + /* + * This buffer is read-only, so should not be successful with commands + * where it is the destination (reads) + */ + mptr = mmap(NULL, 8192, PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); + if (mptr == MAP_FAILED) { + perror("mmap"); + return errno; + } + + meta = mptr; + + cmd.opcode = 1; + cmd.metadata = (uintptr_t)meta; + ret = ioctl(fd, NVME_IOCTL_IO_CMD, &cmd); + if (ret < 0) { + perror("nvme-write (prot_read)"); + return ret; + } + + cmd.opcode = 2; + ret = ioctl(fd, NVME_IOCTL_IO_CMD, &cmd); + if (ret == 0) { + perror("nvme-read (expect Failure)"); + return EFAULT; + } + + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/block/039 new/blktests-0+20250718.d24f744/tests/block/039 --- old/blktests-0+20250415.9aa2023/tests/block/039 1970-01-01 01:00:00.000000000 +0100 +++ new/blktests-0+20250718.d24f744/tests/block/039 2025-07-18 14:01:02.000000000 +0200 @@ -0,0 +1,54 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2025 Western Digital Corporation or its affiliates. +# +# Confirm that concurrent set_blocksize() calls and read paths do not race. +# This is the regression test to confirm the fix by the commit c0e473a0d226 +# ("block: fix race between set_blocksize and read paths"). + +. tests/block/rc +. common/null_blk + +DESCRIPTION="test race between set_blocksize and read paths" +TIMED=1 +CAN_BE_ZONED=1 + +requires() { + _have_fio +} + +change_blocksize() { + local deadline + + deadline=$(( $(_uptime_s) + TIMEOUT)) + + while (($(_uptime_s) < deadline)); do + blockdev --setbsz 4096 /dev/nullb1 + sleep .1 + blockdev --setbsz 8192 /dev/nullb1 + sleep .1 + done +} + +test() { + echo "Running ${TEST_NAME}" + + if ! _configure_null_blk nullb1 power=1; then + return 1 + fi + + if ! blockdev --setbsz 8192 /dev/nullb1; then + SKIP_REASONS+=("kernel does not support block size larger than 4kb") + _exit_null_blk + return + fi + + : "${TIMEOUT:=10}" + change_blocksize & + _run_fio --rw=randread --bs=4K --filename=/dev/nullb1 --name=nullb1 + wait + + _exit_null_blk + + echo "Test complete" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/block/039.out new/blktests-0+20250718.d24f744/tests/block/039.out --- old/blktests-0+20250415.9aa2023/tests/block/039.out 1970-01-01 01:00:00.000000000 +0100 +++ new/blktests-0+20250718.d24f744/tests/block/039.out 2025-07-18 14:01:02.000000000 +0200 @@ -0,0 +1,2 @@ +Running block/039 +Test complete diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/block/040 new/blktests-0+20250718.d24f744/tests/block/040 --- old/blktests-0+20250415.9aa2023/tests/block/040 1970-01-01 01:00:00.000000000 +0100 +++ new/blktests-0+20250718.d24f744/tests/block/040 2025-07-18 14:01:02.000000000 +0200 @@ -0,0 +1,73 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright 2025 Ming Lei <ming....@redhat.com> +# +# Most of code is copied from block/029. +# +# Trigger blk_mq_update_nr_hw_queues() & elevator switch. This test case +# confirms the kernel fix commit b126d9d7475e ("block: don't allow to switch +# elevator if updating nr_hw_queues is in-progress"). + +. tests/block/rc +. common/null_blk + +DESCRIPTION="test blk_mq_update_nr_hw_queues() vs switch elevator" +TIMED=1 + +requires() { + _have_fio + _have_null_blk +} + + +modify_io_sched() { + local deadline + local dev=$1 + + deadline=$(($(_uptime_s) + TIMEOUT)) + while [ "$(_uptime_s)" -lt "$deadline" ]; do + for sched in $(_io_schedulers "$dev"); do + { echo "$sched" > /sys/block/"$dev"/queue/scheduler ;} \ + &> /dev/null + sleep .5 + done + done +} + +modify_nr_hw_queues() { + local deadline num_cpus + + deadline=$(($(_uptime_s) + TIMEOUT)) + num_cpus=$(nproc) + while [ "$(_uptime_s)" -lt "$deadline" ]; do + sleep .1 + echo 1 > /sys/kernel/config/nullb/nullb1/submit_queues + sleep .1 + echo "$num_cpus" > /sys/kernel/config/nullb/nullb1/submit_queues + done +} + +test() { + local sq=/sys/kernel/config/nullb/nullb1/submit_queues + + : "${TIMEOUT:=30}" + _configure_null_blk nullb1 completion_nsec=0 blocksize=512 \ + size=16 memory_backed=1 power=1 && + if { echo 1 >$sq; } 2>/dev/null; then + modify_nr_hw_queues & + modify_io_sched nullb1 & + fio --rw=randwrite --bs=4K --loops=$((10**6)) \ + --iodepth=64 --group_reporting --sync=1 --direct=1 \ + --ioengine=libaio --filename="/dev/nullb1" \ + --runtime="${TIMEOUT}" --name=nullb1 \ + --output="${RESULTS_DIR}/block/fio-output-040.txt" \ + >>"$FULL" + wait + else + SKIP_REASONS+=("$sq cannot be modified") + _exit_null_blk + return + fi + _exit_null_blk + echo Passed +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/block/040.out new/blktests-0+20250718.d24f744/tests/block/040.out --- old/blktests-0+20250415.9aa2023/tests/block/040.out 1970-01-01 01:00:00.000000000 +0100 +++ new/blktests-0+20250718.d24f744/tests/block/040.out 2025-07-18 14:01:02.000000000 +0200 @@ -0,0 +1 @@ +Passed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/loop/010 new/blktests-0+20250718.d24f744/tests/loop/010 --- old/blktests-0+20250415.9aa2023/tests/loop/010 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/tests/loop/010 2025-07-18 14:01:02.000000000 +0200 @@ -78,5 +78,11 @@ if _dmesg_since_test_start | grep --quiet "$grep_str"; then echo "Fail" fi + + # This test generates udev events faster than the rate at which udevd + # can process events. Drain udev events to prevent future test cases + # fail. + _drain_udev_events + echo "Test complete" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/loop/011 new/blktests-0+20250718.d24f744/tests/loop/011 --- old/blktests-0+20250415.9aa2023/tests/loop/011 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/tests/loop/011 2025-07-18 14:01:02.000000000 +0200 @@ -33,7 +33,7 @@ errors=$(_dmesg_since_test_start | grep -c "operation not supported error, dev .*WRITE_ZEROES") losetup --detach "$loop_dev" - umount "$TMPDIR/tmpfs" + umount --lazy "$TMPDIR/tmpfs" echo "Found $errors error(s) in dmesg" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/md/001 new/blktests-0+20250718.d24f744/tests/md/001 --- old/blktests-0+20250415.9aa2023/tests/md/001 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/tests/md/001 2025-07-18 14:01:02.000000000 +0200 @@ -26,6 +26,7 @@ _have_driver dm-mod _have_driver raid1 + _have_nvme_cli_with_json_support _require_nvme_trtype tcp _have_brd } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/md/002 new/blktests-0+20250718.d24f744/tests/md/002 --- old/blktests-0+20250415.9aa2023/tests/md/002 1970-01-01 01:00:00.000000000 +0100 +++ new/blktests-0+20250718.d24f744/tests/md/002 2025-07-18 14:01:02.000000000 +0200 @@ -0,0 +1,247 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2025 Oracle and/or its affiliates +# +# Test SCSI Atomic Writes with MD devices + +. tests/scsi/rc +. common/scsi_debug +. common/xfs + +DESCRIPTION="test md atomic writes" +QUICK=1 + +requires() { + _have_kver 6 14 0 + _have_program mdadm + _have_driver scsi_debug + _have_xfs_io_atomic_write +} + +test() { + local scsi_debug_atomic_wr_max_length + local scsi_debug_atomic_wr_gran + local scsi_sysfs_atomic_max_bytes + local scsi_sysfs_atomic_unit_max_bytes + local scsi_sysfs_atomic_unit_min_bytes + local md_atomic_max_bytes + local md_atomic_min_bytes + local md_sysfs_max_hw_sectors_kb + local md_max_hw_bytes + local md_chunk_size + local md_chunk_size_bytes + local md_sysfs_logical_block_size + local md_sysfs_atomic_max_bytes + local md_sysfs_atomic_unit_max_bytes + local md_sysfs_atomic_unit_min_bytes + local bytes_to_write + local bytes_written + local test_desc + local scsi_0 + local scsi_1 + local scsi_2 + local scsi_3 + local scsi_dev_sysfs + local md_dev + local md_dev_sysfs + local scsi_debug_params=( + delay=0 + atomic_wr=1 + num_tgts=1 + add_host=4 + per_host_store=true + ) + + echo "Running ${TEST_NAME}" + + if ! _configure_scsi_debug "${scsi_debug_params[@]}"; then + return 1 + fi + + scsi_0="${SCSI_DEBUG_DEVICES[0]}" + scsi_1="${SCSI_DEBUG_DEVICES[1]}" + scsi_2="${SCSI_DEBUG_DEVICES[2]}" + scsi_3="${SCSI_DEBUG_DEVICES[3]}" + + scsi_dev_sysfs="/sys/block/${scsi_0}" + scsi_sysfs_atomic_max_bytes=$(< "${scsi_dev_sysfs}"/queue/atomic_write_max_bytes) + scsi_sysfs_atomic_unit_max_bytes=$(< "${scsi_dev_sysfs}"/queue/atomic_write_unit_max_bytes) + scsi_sysfs_atomic_unit_min_bytes=$(< "${scsi_dev_sysfs}"/queue/atomic_write_unit_min_bytes) + scsi_debug_atomic_wr_max_length=$(< /sys/module/scsi_debug/parameters/atomic_wr_max_length) + scsi_debug_atomic_wr_gran=$(< /sys/module/scsi_debug/parameters/atomic_wr_gran) + + for raid_level in 0 1 10; do + if [ "$raid_level" = 10 ] + then + echo y | mdadm --create /dev/md/blktests_md --level=$raid_level \ + --raid-devices=4 --force /dev/"${scsi_0}" /dev/"${scsi_1}" \ + /dev/"${scsi_2}" /dev/"${scsi_3}" 2> /dev/null 1>&2 + else + echo y | mdadm --create /dev/md/blktests_md --level=$raid_level \ + --raid-devices=2 --force \ + /dev/"${scsi_0}" /dev/"${scsi_1}" 2> /dev/null 1>&2 + fi + + md_dev=$(readlink /dev/md/blktests_md | sed 's|\.\./||') + md_dev_sysfs="/sys/devices/virtual/block/${md_dev}" + + md_sysfs_logical_block_size=$(< "${md_dev_sysfs}"/queue/logical_block_size) + md_sysfs_max_hw_sectors_kb=$(< "${md_dev_sysfs}"/queue/max_hw_sectors_kb) + md_max_hw_bytes=$(( "$md_sysfs_max_hw_sectors_kb" * 1024 )) + md_sysfs_atomic_max_bytes=$(< "${md_dev_sysfs}"/queue/atomic_write_max_bytes) + md_sysfs_atomic_unit_max_bytes=$(< "${md_dev_sysfs}"/queue/atomic_write_unit_max_bytes) + md_sysfs_atomic_unit_min_bytes=$(< "${md_dev_sysfs}"/queue/atomic_write_unit_min_bytes) + md_atomic_max_bytes=$(( "$scsi_debug_atomic_wr_max_length" * "$md_sysfs_logical_block_size" )) + md_atomic_min_bytes=$(( "$scsi_debug_atomic_wr_gran" * "$md_sysfs_logical_block_size" )) + + test_desc="TEST 1 RAID $raid_level - Verify md sysfs atomic attributes matches scsi" + if [ "$md_sysfs_atomic_unit_max_bytes" = "$scsi_sysfs_atomic_unit_max_bytes" ] && + [ "$md_sysfs_atomic_unit_min_bytes" = "$scsi_sysfs_atomic_unit_min_bytes" ] + then + echo "$test_desc - pass" + else + echo "$test_desc - fail $md_sysfs_atomic_unit_max_bytes - $scsi_sysfs_atomic_unit_max_bytes -" \ + "$md_sysfs_atomic_unit_min_bytes - $scsi_sysfs_atomic_unit_min_bytes " + fi + + test_desc="TEST 2 RAID $raid_level - Verify sysfs atomic attributes" + if [ "$md_max_hw_bytes" -ge "$md_sysfs_atomic_max_bytes" ] && + [ "$md_sysfs_atomic_max_bytes" -ge "$md_sysfs_atomic_unit_max_bytes" ] && + [ "$md_sysfs_atomic_unit_max_bytes" -ge "$md_sysfs_atomic_unit_min_bytes" ] + then + echo "$test_desc - pass" + else + echo "$test_desc - fail $md_max_hw_bytes - $md_sysfs_max_hw_sectors_kb -" \ + "$md_sysfs_atomic_max_bytes - $md_sysfs_atomic_unit_max_bytes -" \ + "$md_sysfs_atomic_unit_min_bytes" + fi + + test_desc="TEST 3 RAID $raid_level - Verify md sysfs_atomic_max_bytes is less than or equal " + test_desc+="scsi sysfs_atomic_max_bytes" + if [ "$md_sysfs_atomic_max_bytes" -le "$scsi_sysfs_atomic_max_bytes" ] + then + echo "$test_desc - pass" + else + echo "$test_desc - fail $md_sysfs_atomic_max_bytes - $scsi_sysfs_atomic_max_bytes" + fi + + test_desc="TEST 4 RAID $raid_level - check sysfs atomic_write_unit_max_bytes <= scsi_debug atomic_wr_max_length" + if (("$md_sysfs_atomic_unit_max_bytes" <= "$md_atomic_max_bytes")) + then + echo "$test_desc - pass" + else + echo "$test_desc - fail $md_sysfs_atomic_unit_max_bytes - $md_atomic_max_bytes" + fi + + test_desc="TEST 5 RAID $raid_level - check sysfs atomic_write_unit_min_bytes = scsi_debug atomic_wr_gran" + if [ "$md_sysfs_atomic_unit_min_bytes" = "$md_atomic_min_bytes" ] + then + echo "$test_desc - pass" + else + echo "$test_desc - fail $md_sysfs_atomic_unit_min_bytes - $md_atomic_min_bytes" + fi + + test_desc="TEST 6 RAID $raid_level - check statx stx_atomic_write_unit_min" + statx_atomic_min=$(run_xfs_io_xstat /dev/"$md_dev" "stat.atomic_write_unit_min") + if [ "$statx_atomic_min" = "$md_atomic_min_bytes" ] + then + echo "$test_desc - pass" + else + echo "$test_desc - fail $statx_atomic_min - $md_atomic_min_bytes" + fi + + test_desc="TEST 7 RAID $raid_level - check statx stx_atomic_write_unit_max" + statx_atomic_max=$(run_xfs_io_xstat /dev/"$md_dev" "stat.atomic_write_unit_max") + if [ "$statx_atomic_max" = "$md_sysfs_atomic_unit_max_bytes" ] + then + echo "$test_desc - pass" + else + echo "$test_desc - fail $statx_atomic_max - $md_sysfs_atomic_unit_max_bytes" + fi + + test_desc="TEST 8 RAID $raid_level - perform a pwritev2 with size of sysfs_atomic_unit_max_bytes with " + test_desc+="RWF_ATOMIC flag - pwritev2 should be succesful" + bytes_written=$(run_xfs_io_pwritev2_atomic /dev/"$md_dev" "$md_sysfs_atomic_unit_max_bytes") + if [ "$bytes_written" = "$md_sysfs_atomic_unit_max_bytes" ] + then + echo "$test_desc - pass" + else + echo "$test_desc - fail $bytes_written - $md_sysfs_atomic_unit_max_bytes" + fi + + test_desc="TEST 9 RAID $raid_level - perform a pwritev2 with size of sysfs_atomic_unit_max_bytes + 512 " + test_desc+="bytes with RWF_ATOMIC flag - pwritev2 should not be succesful" + bytes_to_write=$(( "${md_sysfs_atomic_unit_max_bytes}" + 512 )) + bytes_written=$(run_xfs_io_pwritev2_atomic /dev/"$md_dev" "$bytes_to_write") + if [ "$bytes_written" = "" ] + then + echo "$test_desc - pass" + else + echo "$test_desc - fail $bytes_written - $bytes_to_write" + fi + + test_desc="TEST 10 RAID $raid_level - perform a pwritev2 with size of sysfs_atomic_unit_min_bytes " + test_desc+="with RWF_ATOMIC flag - pwritev2 should be succesful" + bytes_written=$(run_xfs_io_pwritev2_atomic /dev/"$md_dev" "$md_sysfs_atomic_unit_min_bytes") + if [ "$bytes_written" = "$md_sysfs_atomic_unit_min_bytes" ] + then + echo "$test_desc - pass" + else + echo "$test_desc - fail $bytes_written - $md_atomic_min_bytes" + fi + + bytes_to_write=$(( "${md_sysfs_atomic_unit_min_bytes}" - "${md_sysfs_logical_block_size}" )) + test_desc="TEST 11 RAID $raid_level - perform a pwritev2 with a size of sysfs_atomic_unit_min_bytes - 512 " + test_desc+="bytes with RWF_ATOMIC flag - pwritev2 should fail" + if [ "$bytes_to_write" = 0 ] + then + echo "$test_desc - pass" + else + bytes_written=$(run_xfs_io_pwritev2_atomic /dev/"$md_dev" "$bytes_to_write") + if [ "$bytes_written" = "" ] + then + echo "$test_desc - pass" + else + echo "$test_desc - fail $bytes_written - $bytes_to_write" + fi + fi + + mdadm --stop /dev/md/blktests_md 2> /dev/null 1>&2 + + if [ "$raid_level" = 0 ] || [ "$raid_level" = 10 ] + then + md_chunk_size=$(( "$scsi_sysfs_atomic_unit_max_bytes" / 2048)) + + if [ "$raid_level" = 0 ] + then + echo y | mdadm --create /dev/md/blktests_md --level=$raid_level \ + --raid-devices=2 --chunk="${md_chunk_size}"K --force \ + /dev/"${scsi_0}" /dev/"${scsi_1}" 2> /dev/null 1>&2 + else + echo y | mdadm --create /dev/md/blktests_md --level=$raid_level \ + --raid-devices=4 --chunk="${md_chunk_size}"K --force \ + /dev/"${scsi_0}" /dev/"${scsi_1}" \ + /dev/"${scsi_2}" /dev/"${scsi_3}" 2> /dev/null 1>&2 + fi + + md_dev=$(readlink /dev/md/blktests_md | sed 's|\.\./||') + md_dev_sysfs="/sys/devices/virtual/block/${md_dev}" + md_sysfs_atomic_unit_max_bytes=$(< "${md_dev_sysfs}"/queue/atomic_write_unit_max_bytes) + md_chunk_size_bytes=$(( "$md_chunk_size" * 1024)) + test_desc="TEST 12 RAID $raid_level - Verify chunk size " + if [ "$md_chunk_size_bytes" -le "$md_sysfs_atomic_unit_max_bytes" ] && \ + (( md_sysfs_atomic_unit_max_bytes % md_chunk_size_bytes == 0 )) + then + echo "$test_desc - pass" + else + echo "$test_desc - fail $md_chunk_size_bytes - $md_sysfs_atomic_unit_max_bytes" + fi + + mdadm --quiet --stop /dev/md/blktests_md + fi + done + + _exit_scsi_debug + + echo "Test complete" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/md/002.out new/blktests-0+20250718.d24f744/tests/md/002.out --- old/blktests-0+20250415.9aa2023/tests/md/002.out 1970-01-01 01:00:00.000000000 +0100 +++ new/blktests-0+20250718.d24f744/tests/md/002.out 2025-07-18 14:01:02.000000000 +0200 @@ -0,0 +1,43 @@ +Running md/002 +TEST 1 RAID 0 - Verify md sysfs atomic attributes matches scsi - pass +TEST 2 RAID 0 - Verify sysfs atomic attributes - pass +TEST 3 RAID 0 - Verify md sysfs_atomic_max_bytes is less than or equal scsi sysfs_atomic_max_bytes - pass +TEST 4 RAID 0 - check sysfs atomic_write_unit_max_bytes <= scsi_debug atomic_wr_max_length - pass +TEST 5 RAID 0 - check sysfs atomic_write_unit_min_bytes = scsi_debug atomic_wr_gran - pass +TEST 6 RAID 0 - check statx stx_atomic_write_unit_min - pass +TEST 7 RAID 0 - check statx stx_atomic_write_unit_max - pass +TEST 8 RAID 0 - perform a pwritev2 with size of sysfs_atomic_unit_max_bytes with RWF_ATOMIC flag - pwritev2 should be succesful - pass +pwrite: Invalid argument +TEST 9 RAID 0 - perform a pwritev2 with size of sysfs_atomic_unit_max_bytes + 512 bytes with RWF_ATOMIC flag - pwritev2 should not be succesful - pass +TEST 10 RAID 0 - perform a pwritev2 with size of sysfs_atomic_unit_min_bytes with RWF_ATOMIC flag - pwritev2 should be succesful - pass +pwrite: Invalid argument +TEST 11 RAID 0 - perform a pwritev2 with a size of sysfs_atomic_unit_min_bytes - 512 bytes with RWF_ATOMIC flag - pwritev2 should fail - pass +TEST 12 RAID 0 - Verify chunk size - pass +TEST 1 RAID 1 - Verify md sysfs atomic attributes matches scsi - pass +TEST 2 RAID 1 - Verify sysfs atomic attributes - pass +TEST 3 RAID 1 - Verify md sysfs_atomic_max_bytes is less than or equal scsi sysfs_atomic_max_bytes - pass +TEST 4 RAID 1 - check sysfs atomic_write_unit_max_bytes <= scsi_debug atomic_wr_max_length - pass +TEST 5 RAID 1 - check sysfs atomic_write_unit_min_bytes = scsi_debug atomic_wr_gran - pass +TEST 6 RAID 1 - check statx stx_atomic_write_unit_min - pass +TEST 7 RAID 1 - check statx stx_atomic_write_unit_max - pass +TEST 8 RAID 1 - perform a pwritev2 with size of sysfs_atomic_unit_max_bytes with RWF_ATOMIC flag - pwritev2 should be succesful - pass +pwrite: Invalid argument +TEST 9 RAID 1 - perform a pwritev2 with size of sysfs_atomic_unit_max_bytes + 512 bytes with RWF_ATOMIC flag - pwritev2 should not be succesful - pass +TEST 10 RAID 1 - perform a pwritev2 with size of sysfs_atomic_unit_min_bytes with RWF_ATOMIC flag - pwritev2 should be succesful - pass +pwrite: Invalid argument +TEST 11 RAID 1 - perform a pwritev2 with a size of sysfs_atomic_unit_min_bytes - 512 bytes with RWF_ATOMIC flag - pwritev2 should fail - pass +TEST 1 RAID 10 - Verify md sysfs atomic attributes matches scsi - pass +TEST 2 RAID 10 - Verify sysfs atomic attributes - pass +TEST 3 RAID 10 - Verify md sysfs_atomic_max_bytes is less than or equal scsi sysfs_atomic_max_bytes - pass +TEST 4 RAID 10 - check sysfs atomic_write_unit_max_bytes <= scsi_debug atomic_wr_max_length - pass +TEST 5 RAID 10 - check sysfs atomic_write_unit_min_bytes = scsi_debug atomic_wr_gran - pass +TEST 6 RAID 10 - check statx stx_atomic_write_unit_min - pass +TEST 7 RAID 10 - check statx stx_atomic_write_unit_max - pass +TEST 8 RAID 10 - perform a pwritev2 with size of sysfs_atomic_unit_max_bytes with RWF_ATOMIC flag - pwritev2 should be succesful - pass +pwrite: Invalid argument +TEST 9 RAID 10 - perform a pwritev2 with size of sysfs_atomic_unit_max_bytes + 512 bytes with RWF_ATOMIC flag - pwritev2 should not be succesful - pass +TEST 10 RAID 10 - perform a pwritev2 with size of sysfs_atomic_unit_min_bytes with RWF_ATOMIC flag - pwritev2 should be succesful - pass +pwrite: Invalid argument +TEST 11 RAID 10 - perform a pwritev2 with a size of sysfs_atomic_unit_min_bytes - 512 bytes with RWF_ATOMIC flag - pwritev2 should fail - pass +TEST 12 RAID 10 - Verify chunk size - pass +Test complete diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/nvme/034 new/blktests-0+20250718.d24f744/tests/nvme/034 --- old/blktests-0+20250415.9aa2023/tests/nvme/034 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/tests/nvme/034 2025-07-18 14:01:02.000000000 +0200 @@ -16,6 +16,7 @@ device_requires() { _require_test_dev_is_not_nvme_multipath + _test_dev_has_no_metadata } set_conditions() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/nvme/035 new/blktests-0+20250718.d24f744/tests/nvme/035 --- old/blktests-0+20250415.9aa2023/tests/nvme/035 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/tests/nvme/035 2025-07-18 14:01:02.000000000 +0200 @@ -20,6 +20,7 @@ _require_test_dev_is_not_nvme_multipath _require_test_dev_size "${NVME_IMG_SIZE}" _test_dev_suits_xfs + _test_dev_has_no_metadata } set_conditions() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/nvme/049 new/blktests-0+20250718.d24f744/tests/nvme/049 --- old/blktests-0+20250415.9aa2023/tests/nvme/049 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/tests/nvme/049 2025-07-18 14:01:02.000000000 +0200 @@ -15,6 +15,15 @@ _have_fio_ver 3 33 } +metadata_bytes_per_4k_io() { + local phys_bs md_bytes + + phys_bs=$(<"${TEST_DEV_SYSFS}"/queue/physical_block_size) + md_bytes=$(<"${TEST_DEV_SYSFS}"/metadata_bytes) + + echo $((4096 * md_bytes / phys_bs)) +} + test_device() { echo "Running ${TEST_NAME}" @@ -23,6 +32,7 @@ local target_size=4096 local common_args=() local fio_output + local md_io_bytes test_dev_bs=$(_min_io "$ngdev") common_args=( @@ -39,6 +49,9 @@ --runtime=2 ) + md_io_bytes=$(metadata_bytes_per_4k_io) + ((md_io_bytes)) && common_args+=(--md_per_io_size="${md_io_bytes}") + ((test_dev_bs > target_size)) && target_size=$test_dev_bs # check security permission diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/nvme/054 new/blktests-0+20250718.d24f744/tests/nvme/054 --- old/blktests-0+20250415.9aa2023/tests/nvme/054 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/tests/nvme/054 2025-07-18 14:01:02.000000000 +0200 @@ -9,10 +9,14 @@ DESCRIPTION="Test the NVMe reservation feature" QUICK=1 -nvme_trtype="loop" requires() { _nvme_requires + _require_nvme_trtype_is_fabrics +} + +set_conditions() { + _set_nvme_trtype "$@" } resv_report() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/nvme/063 new/blktests-0+20250718.d24f744/tests/nvme/063 --- old/blktests-0+20250415.9aa2023/tests/nvme/063 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/tests/nvme/063 2025-07-18 14:01:02.000000000 +0200 @@ -93,7 +93,7 @@ _nvme_connect_subsys --dhchap-secret "${hostkey}" --concat ctrl=$(_find_nvme_dev "${def_subsysnqn}") - if _nvme_ctrl_tls_key "$ctrl" > /dev/null ; then + if ! _nvme_ctrl_tls_key "$ctrl" > /dev/null ; then echo "WARNING: connection is not encrypted" _systemctl_stop return 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/nvme/064 new/blktests-0+20250718.d24f744/tests/nvme/064 --- old/blktests-0+20250415.9aa2023/tests/nvme/064 1970-01-01 01:00:00.000000000 +0100 +++ new/blktests-0+20250718.d24f744/tests/nvme/064 2025-07-18 14:01:02.000000000 +0200 @@ -0,0 +1,34 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2025 Keith Busch <kbu...@kernel.org> +# +# Test out metadata through the passthrough interfaces. This test confirms the +# fix by the kernel commit 43a67dd812c5 ("block: flip iter directions in +# blk_rq_integrity_map_user()"). This test requires TEST_DEV as a namespace +# formatted with metadata, and extended LBA disabled. Such namespace can be +# prepared with QEMU NVME emulation specifying -device option with "ms=8", +# "ms=16" or "ms=64". + +. tests/nvme/rc + +requires() { + _nvme_requires +} + +device_requires() { + _test_dev_has_metadata + _test_dev_disables_extended_lba +} + +DESCRIPTION="exercise the nvme metadata usage with passthrough commands" +QUICK=1 + +test_device() { + echo "Running ${TEST_NAME}" + + if ! src/nvme-passthrough-meta "${TEST_DEV}"; then + echo "src/nvme-passthrough-meta failed" + fi + + echo "Test complete" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/nvme/064.out new/blktests-0+20250718.d24f744/tests/nvme/064.out --- old/blktests-0+20250415.9aa2023/tests/nvme/064.out 1970-01-01 01:00:00.000000000 +0100 +++ new/blktests-0+20250718.d24f744/tests/nvme/064.out 2025-07-18 14:01:02.000000000 +0200 @@ -0,0 +1,2 @@ +Running nvme/064 +Test complete diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/nvme/rc new/blktests-0+20250718.d24f744/tests/nvme/rc --- old/blktests-0+20250415.9aa2023/tests/nvme/rc 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/tests/nvme/rc 2025-07-18 14:01:02.000000000 +0200 @@ -55,7 +55,6 @@ } _nvme_requires() { - _have_program nvme _require_nvme_test_img_size 4m case ${nvme_trtype} in loop) @@ -123,6 +122,7 @@ group_requires() { _have_root _NVMET_TRTYPES_is_valid + _have_nvme_cli_with_json_support } group_device_requires() { @@ -153,6 +153,39 @@ return 0 } +_test_dev_has_metadata() { + if [ ! -e "${TEST_DEV_SYSFS}/metadata_bytes" ] || \ + (( ! $(<"${TEST_DEV_SYSFS}/metadata_bytes") )); then + SKIP_REASONS+=("$TEST_DEV does not have metadata") + return 1 + fi + return 0 +} + +_test_dev_has_no_metadata() { + if [ -e "${TEST_DEV_SYSFS}/metadata_bytes" ] && + (( $(<"${TEST_DEV_SYSFS}/metadata_bytes") )); then + SKIP_REASONS+=("$TEST_DEV has metadata") + return 1 + fi + return 0 +} + +_test_dev_disables_extended_lba() { + local flbas + + if ! flbas=$(nvme id-ns "$TEST_DEV" | grep flbas | \ + sed --quiet 's/.*: \(.*\)/\1/p'); then + SKIP_REASONS+=("$TEST_DEV does not have namespace flbas field") + return 1 + fi + if (( flbas & 0x10 )); then + SKIP_REASONS+=("$TEST_DEV enables NVME_NS_FLBAS_META_EXT") + return 1 + fi + return 0 +} + _require_nvme_test_img_size() { local require_sz_mb local nvme_img_size_mb @@ -177,7 +210,7 @@ _require_nvme_cli_tls() { if ! nvme gen-tls-key --subsysnqn nvmf-test-subsys > /dev/null 2>&1; then - SKIP_REASON+=("nvme gen-tls-key command missing") + SKIP_REASONS+=("nvme gen-tls-key command missing") return 1 fi return 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/throtl/007 new/blktests-0+20250718.d24f744/tests/throtl/007 --- old/blktests-0+20250415.9aa2023/tests/throtl/007 1970-01-01 01:00:00.000000000 +0100 +++ new/blktests-0+20250718.d24f744/tests/throtl/007 2025-07-18 14:01:02.000000000 +0200 @@ -0,0 +1,45 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2025 Zizhi Wo +# +# Test the combination of bps and iops limits under io splitting scenarios. +# Regression test for commit d1ba22ab2bec ("blk-throttle: Prevents the bps +# restricted io from entering the bps queue again") + +. tests/throtl/rc + +DESCRIPTION="bps limit with iops limit over io split" +QUICK=1 + +test() { + echo "Running ${TEST_NAME}" + + local page_size max_secs + page_size=$(getconf PAGE_SIZE) + max_secs=$((page_size / 512)) + + if ! _set_up_throtl max_sectors="${max_secs}"; then + return 1; + fi + + local bps_limit=$((1024 * 1024)) + local iops_limit=1000000 + + # just set bps limit first + _throtl_set_limits wbps=$bps_limit + _throtl_test_io write 1M 1 & + _throtl_test_io write 1M 1 & + wait + _throtl_remove_limits + + # set the same bps limit and a high iops limit + # should behave the same as no iops limit + _throtl_set_limits wbps=$bps_limit wiops=$iops_limit + _throtl_test_io write 1M 1 & + _throtl_test_io write 1M 1 & + wait + _throtl_remove_limits + + _clean_up_throtl + echo "Test complete" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/throtl/007.out new/blktests-0+20250718.d24f744/tests/throtl/007.out --- old/blktests-0+20250415.9aa2023/tests/throtl/007.out 1970-01-01 01:00:00.000000000 +0100 +++ new/blktests-0+20250718.d24f744/tests/throtl/007.out 2025-07-18 14:01:02.000000000 +0200 @@ -0,0 +1,6 @@ +Running throtl/007 +1 +2 +1 +2 +Test complete diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blktests-0+20250415.9aa2023/tests/zbd/006 new/blktests-0+20250718.d24f744/tests/zbd/006 --- old/blktests-0+20250415.9aa2023/tests/zbd/006 2025-04-15 07:41:27.000000000 +0200 +++ new/blktests-0+20250718.d24f744/tests/zbd/006 2025-07-18 14:01:02.000000000 +0200 @@ -36,7 +36,8 @@ offset=$((ZONE_STARTS[zone_idx] * 512)) size=$((ZONE_LENGTHS[zone_idx] * 512)) - blkzone reset -o "${ZONE_STARTS[zone_idx]}" "${TEST_DEV}" + blkzone reset --offset "${ZONE_STARTS[zone_idx]}" --count 1 \ + "${TEST_DEV}" _test_dev_set_scheduler deadline