linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH blktests v2 0/3] blktest: add unmap write zeroes tests
@ 2025-08-13  2:44 Zhang Yi
  2025-08-13  2:44 ` [PATCH blktests v2 1/3] scsi/010: " Zhang Yi
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Zhang Yi @ 2025-08-13  2:44 UTC (permalink / raw)
  To: linux-fsdevel, linux-block, dm-devel, linux-nvme, linux-scsi
  Cc: linux-kernel, hch, tytso, djwong, bmarzins, chaitanyak,
	shinichiro.kawasaki, brauner, martin.petersen, yi.zhang, yi.zhang,
	chengzhihao1, yukuai3, yangerkun

From: Zhang Yi <yi.zhang@huawei.com>

Change since v2:
 - Modify the sysfs interfaces according to the kernel implementation.
 - Determine whether the kernel supports it by directly checking the
   existence of the sysfs interface, instead of using device_requries(). 
 - Drop _short_dev() helper and directly use _real_dev() to acquire dm
   path.
 - Check the return value of setup_test_device().
 - Fix the '"make check'" errors.


The Linux kernel (since version 6.17)[1] supports FALLOC_FL_WRITE_ZEROES
in fallocate(2) and add max_{hw|user}_wzeroes_unmap_sectors parameters
to the block device queue limit. These tests test those block device
unmap write zeroes sysfs interface

        /sys/block/<disk>/queue/write_zeroes_max_bytes
        /sys/block/<disk>/queue/write_zeroes_unmap_max_hw_bytes

with various SCSI/NVMe/device-mapper devices.

The value of /sys/block//queue/write_zeroes_unmap_max_hw_bytes should be
equal to a nonzero value of /sys/block//queue/write_zeroes_max_bytes if
the block device supports the unmap write zeroes command; otherwise, it
should return 0. We can also disable unmap write zeroes command by
setting /sys/block/<disk>/queue/write_zeroes_max_bytes to 0.

 - scsi/010 test SCSI devices.
 - dm/003 test device mapper stacked devices.
 - nvme/065 test NVMe devices.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=278c7d9b5e0c

Thanks,
Yi.

Zhang Yi (3):
  scsi/010: add unmap write zeroes tests
  dm/003: add unmap write zeroes tests
  nvme/065: add unmap write zeroes tests

 common/rc          | 10 +++++
 tests/dm/003       | 86 +++++++++++++++++++++++++++++++++++++++++
 tests/dm/003.out   |  2 +
 tests/nvme/065     | 96 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/065.out |  4 ++
 tests/scsi/010     | 84 ++++++++++++++++++++++++++++++++++++++++
 tests/scsi/010.out |  2 +
 7 files changed, 284 insertions(+)
 create mode 100755 tests/dm/003
 create mode 100644 tests/dm/003.out
 create mode 100755 tests/nvme/065
 create mode 100644 tests/nvme/065.out
 create mode 100755 tests/scsi/010
 create mode 100644 tests/scsi/010.out

-- 
2.39.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH blktests v2 1/3] scsi/010: add unmap write zeroes tests
  2025-08-13  2:44 [PATCH blktests v2 0/3] blktest: add unmap write zeroes tests Zhang Yi
@ 2025-08-13  2:44 ` Zhang Yi
  2025-08-13  2:44 ` [PATCH blktests v2 2/3] dm/003: " Zhang Yi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Zhang Yi @ 2025-08-13  2:44 UTC (permalink / raw)
  To: linux-fsdevel, linux-block, dm-devel, linux-nvme, linux-scsi
  Cc: linux-kernel, hch, tytso, djwong, bmarzins, chaitanyak,
	shinichiro.kawasaki, brauner, martin.petersen, yi.zhang, yi.zhang,
	chengzhihao1, yukuai3, yangerkun

From: Zhang Yi <yi.zhang@huawei.com>

Test block device unmap write zeroes sysfs interface with various SCSI
debug devices. /sys/block/<disk>/queue/write_zeroes_unmap_max_hw_bytes
should equal to the write_zeroes_max_bytes if the SCSI device enable the
WRITE SAME command with unmap functionality, and it should return 0
otherwise. /sys/block/<disk>/queue/write_zeroes_unmap_max_bytes should
be equal to write_zeroes_unmap_max_hw_bytes by default, and we can
disable write zeroes support by setting it to zero.

Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
---
 tests/scsi/010     | 84 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/scsi/010.out |  2 ++
 2 files changed, 86 insertions(+)
 create mode 100755 tests/scsi/010
 create mode 100644 tests/scsi/010.out

diff --git a/tests/scsi/010 b/tests/scsi/010
new file mode 100755
index 0000000..c5152a4
--- /dev/null
+++ b/tests/scsi/010
@@ -0,0 +1,84 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2025 Huawei.
+#
+# Test block device unmap write zeroes sysfs interface with various scsi
+# devices.
+
+. tests/scsi/rc
+. common/scsi_debug
+
+DESCRIPTION="test unmap write zeroes sysfs interface with scsi devices"
+QUICK=1
+
+requires() {
+	_have_scsi_debug
+}
+
+setup_test_device() {
+	if ! _configure_scsi_debug "$@"; then
+		return 1
+	fi
+
+	if [[ ! -f /sys/block/${SCSI_DEBUG_DEVICES[0]}/queue/write_zeroes_unmap_max_hw_bytes ]]; then
+		_exit_scsi_debug
+		SKIP_REASONS+=("kernel does not support unmap write zeroes sysfs interface")
+		return 1
+	fi
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	# disable WRITE SAME with unmap
+	if ! setup_test_device lbprz=0; then
+		return 1
+	fi
+
+	umap_hw_bytes="$(cat "/sys/block/${SCSI_DEBUG_DEVICES[0]}/queue/write_zeroes_unmap_max_hw_bytes")"
+	umap_bytes="$(cat "/sys/block/${SCSI_DEBUG_DEVICES[0]}/queue/write_zeroes_unmap_max_bytes")"
+	if [[ $umap_hw_bytes -ne 0 || $umap_bytes -ne 0 ]]; then
+		echo "Test disable WRITE SAME with unmap failed."
+	fi
+	_exit_scsi_debug
+
+	# enable WRITE SAME(16) with unmap
+	if ! setup_test_device lbprz=1 lbpws=1; then
+		return 1
+	fi
+
+	zero_bytes="$(cat "/sys/block/${SCSI_DEBUG_DEVICES[0]}/queue/write_zeroes_max_bytes")"
+	umap_hw_bytes="$(cat "/sys/block/${SCSI_DEBUG_DEVICES[0]}/queue/write_zeroes_unmap_max_hw_bytes")"
+	umap_bytes="$(cat "/sys/block/${SCSI_DEBUG_DEVICES[0]}/queue/write_zeroes_unmap_max_bytes")"
+	if [[ $umap_hw_bytes -ne $zero_bytes || $umap_bytes -ne $zero_bytes ]]; then
+		echo "Test enable WRITE SAME(16) with unmap failed."
+	fi
+
+	echo 0 > "/sys/block/${SCSI_DEBUG_DEVICES[0]}/queue/write_zeroes_unmap_max_bytes"
+	umap_bytes="$(cat "/sys/block/${SCSI_DEBUG_DEVICES[0]}/queue/write_zeroes_unmap_max_bytes")"
+	if [[ $umap_bytes -ne 0 ]]; then
+		echo "Test manually disable WRITE SAME(16) with unmap failed."
+	fi
+	_exit_scsi_debug
+
+	# enable WRITE SAME(10) with unmap
+	if ! setup_test_device lbprz=1 lbpws10=1; then
+		return 1
+	fi
+
+	zero_bytes="$(cat "/sys/block/${SCSI_DEBUG_DEVICES[0]}/queue/write_zeroes_max_bytes")"
+	umap_hw_bytes="$(cat "/sys/block/${SCSI_DEBUG_DEVICES[0]}/queue/write_zeroes_unmap_max_hw_bytes")"
+	umap_bytes="$(cat "/sys/block/${SCSI_DEBUG_DEVICES[0]}/queue/write_zeroes_unmap_max_bytes")"
+	if [[ $umap_hw_bytes -ne $zero_bytes || $umap_bytes -ne $zero_bytes ]]; then
+		echo "Test enable WRITE SAME(10) with unmap failed."
+	fi
+
+	echo 0 > "/sys/block/${SCSI_DEBUG_DEVICES[0]}/queue/write_zeroes_unmap_max_bytes"
+	umap_bytes="$(cat "/sys/block/${SCSI_DEBUG_DEVICES[0]}/queue/write_zeroes_unmap_max_bytes")"
+	if [[ $umap_bytes -ne 0 ]]; then
+		echo "Test manually disable WRITE SAME(10) with unmap failed."
+	fi
+	_exit_scsi_debug
+
+	echo "Test complete"
+}
diff --git a/tests/scsi/010.out b/tests/scsi/010.out
new file mode 100644
index 0000000..6581d5e
--- /dev/null
+++ b/tests/scsi/010.out
@@ -0,0 +1,2 @@
+Running scsi/010
+Test complete
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH blktests v2 2/3] dm/003: add unmap write zeroes tests
  2025-08-13  2:44 [PATCH blktests v2 0/3] blktest: add unmap write zeroes tests Zhang Yi
  2025-08-13  2:44 ` [PATCH blktests v2 1/3] scsi/010: " Zhang Yi
@ 2025-08-13  2:44 ` Zhang Yi
  2025-08-13  2:44 ` [PATCH blktests v2 3/3] nvme/065: " Zhang Yi
  2025-08-17  6:14 ` [PATCH blktests v2 0/3] blktest: " Shinichiro Kawasaki
  3 siblings, 0 replies; 6+ messages in thread
From: Zhang Yi @ 2025-08-13  2:44 UTC (permalink / raw)
  To: linux-fsdevel, linux-block, dm-devel, linux-nvme, linux-scsi
  Cc: linux-kernel, hch, tytso, djwong, bmarzins, chaitanyak,
	shinichiro.kawasaki, brauner, martin.petersen, yi.zhang, yi.zhang,
	chengzhihao1, yukuai3, yangerkun

From: Zhang Yi <yi.zhang@huawei.com>

Test block device unmap write zeroes sysfs interface with device-mapper
stacked devices. The sysfs parameters should inherit from the underlying
SCSI device. We can disable write zeroes support by setting
/sys/block/dm-<X>/queue/write_zeroes_unmap_max_bytes to zero.

Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
---
 common/rc        | 10 ++++++
 tests/dm/003     | 86 ++++++++++++++++++++++++++++++++++++++++++++++++
 tests/dm/003.out |  2 ++
 3 files changed, 98 insertions(+)
 create mode 100755 tests/dm/003
 create mode 100644 tests/dm/003.out

diff --git a/common/rc b/common/rc
index dfc389f..bb96a88 100644
--- a/common/rc
+++ b/common/rc
@@ -668,3 +668,13 @@ _io_uring_restore()
 		echo "$IO_URING_DISABLED" > /proc/sys/kernel/io_uring_disabled
 	fi
 }
+
+# get real device path name by following link
+_real_dev()
+{
+	local dev=$1
+	if [ -b "$dev" ] && [ -L "$dev" ]; then
+		dev=$(readlink -f "$dev")
+	fi
+	echo $dev
+}
diff --git a/tests/dm/003 b/tests/dm/003
new file mode 100755
index 0000000..0b6bce2
--- /dev/null
+++ b/tests/dm/003
@@ -0,0 +1,86 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2025 Huawei.
+#
+# Test block device unmap write zeroes sysfs interface with device-mapper
+# stacked devices.
+
+. tests/dm/rc
+. common/scsi_debug
+
+DESCRIPTION="test unmap write zeroes sysfs interface with dm devices"
+QUICK=1
+
+requires() {
+	_have_scsi_debug
+}
+
+readonly TO_SKIP=255
+
+setup_test_device() {
+	local dev blk_sz dpath
+
+	if ! _configure_scsi_debug "$@"; then
+		return 1
+	fi
+
+	if [[ ! -f /sys/block/${SCSI_DEBUG_DEVICES[0]}/queue/write_zeroes_unmap_max_hw_bytes ]]; then
+		_exit_scsi_debug
+		return $TO_SKIP
+	fi
+
+	dev="/dev/${SCSI_DEBUG_DEVICES[0]}"
+	blk_sz="$(blockdev --getsz "$dev")"
+	dmsetup create test --table "0 $blk_sz linear $dev 0"
+
+	dpath=$(_real_dev /dev/mapper/test)
+	echo "${dpath##*/}"
+}
+
+cleanup_test_device() {
+	dmsetup remove test
+	_exit_scsi_debug
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	# disable WRITE SAME with unmap
+	local dname
+	dname=$(setup_test_device lbprz=0)
+	ret=$?
+	if ((ret)); then
+		if ((ret == TO_SKIP)); then
+			SKIP_REASONS+=("kernel does not support unmap write zeroes sysfs interface")
+		fi
+		return 1
+	fi
+
+	umap_hw_bytes="$(cat "/sys/block/$dname/queue/write_zeroes_unmap_max_hw_bytes")"
+	umap_bytes="$(cat "/sys/block/$dname/queue/write_zeroes_unmap_max_bytes")"
+	if [[ $umap_hw_bytes -ne 0 || $umap_bytes -ne 0 ]]; then
+		echo "Test disable WRITE SAME with unmap failed."
+	fi
+	cleanup_test_device
+
+	# enable WRITE SAME with unmap
+	if ! dname=$(setup_test_device lbprz=1 lbpws=1); then
+		return 1
+	fi
+
+	zero_bytes="$(cat "/sys/block/$dname/queue/write_zeroes_max_bytes")"
+	umap_hw_bytes="$(cat "/sys/block/$dname/queue/write_zeroes_unmap_max_hw_bytes")"
+	umap_bytes="$(cat "/sys/block/$dname/queue/write_zeroes_unmap_max_bytes")"
+	if [[ $umap_hw_bytes -ne $zero_bytes || $umap_bytes -ne $zero_bytes ]]; then
+		echo "Test enable WRITE SAME with unmap failed."
+	fi
+
+	echo 0 > "/sys/block/$dname/queue/write_zeroes_unmap_max_bytes"
+	umap_bytes="$(cat "/sys/block/$dname/queue/write_zeroes_unmap_max_bytes")"
+	if [[ $umap_bytes -ne 0 ]]; then
+		echo "Test manually disable WRITE SAME with unmap failed."
+	fi
+	cleanup_test_device
+
+	echo "Test complete"
+}
diff --git a/tests/dm/003.out b/tests/dm/003.out
new file mode 100644
index 0000000..51a5405
--- /dev/null
+++ b/tests/dm/003.out
@@ -0,0 +1,2 @@
+Running dm/003
+Test complete
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH blktests v2 3/3] nvme/065: add unmap write zeroes tests
  2025-08-13  2:44 [PATCH blktests v2 0/3] blktest: add unmap write zeroes tests Zhang Yi
  2025-08-13  2:44 ` [PATCH blktests v2 1/3] scsi/010: " Zhang Yi
  2025-08-13  2:44 ` [PATCH blktests v2 2/3] dm/003: " Zhang Yi
@ 2025-08-13  2:44 ` Zhang Yi
  2025-08-17  6:14 ` [PATCH blktests v2 0/3] blktest: " Shinichiro Kawasaki
  3 siblings, 0 replies; 6+ messages in thread
From: Zhang Yi @ 2025-08-13  2:44 UTC (permalink / raw)
  To: linux-fsdevel, linux-block, dm-devel, linux-nvme, linux-scsi
  Cc: linux-kernel, hch, tytso, djwong, bmarzins, chaitanyak,
	shinichiro.kawasaki, brauner, martin.petersen, yi.zhang, yi.zhang,
	chengzhihao1, yukuai3, yangerkun

From: Zhang Yi <yi.zhang@huawei.com>

Test block device unmap write zeroes sysfs interface with NVMeT devices
which are based on various SCSI debug devices. The NVMe device's
/sys/block/<disk>/queue/write_zeroes_unmap_max_hw_bytes
should equal to the write_zeroes_max_bytes if the SCSI debug device
enable the WRITE SAME command with unmap functionality, and it should
return 0 otherwise. /sys/block/<disk>/queue/write_zeroes_unmap_max_bytes
should be equal to write_zeroes_unmap_max_hw_bytes by default, and we
can disable write zeroes support by setting it to zero.

Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
---
 tests/nvme/065     | 96 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/065.out |  4 ++
 2 files changed, 100 insertions(+)
 create mode 100755 tests/nvme/065
 create mode 100644 tests/nvme/065.out

diff --git a/tests/nvme/065 b/tests/nvme/065
new file mode 100755
index 0000000..8631bfa
--- /dev/null
+++ b/tests/nvme/065
@@ -0,0 +1,96 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2025 Huawei.
+#
+# Test block device unmap write zeroes sysfs interface with nvmet scsi
+# debug devices.
+
+. tests/nvme/rc
+. common/scsi_debug
+
+DESCRIPTION="test unmap write zeroes sysfs interface with nvmet devices"
+QUICK=1
+
+nvme_trtype=loop
+nvmet_blkdev_type="device"
+
+requires() {
+	_have_scsi_debug
+	_nvme_requires
+	_require_nvme_trtype_is_loop
+}
+
+readonly TO_SKIP=255
+
+setup_test_device() {
+	local port
+
+	if ! _configure_scsi_debug "$@"; then
+		return 1
+	fi
+
+	if [[ ! -f /sys/block/${SCSI_DEBUG_DEVICES[0]}/queue/write_zeroes_unmap_max_hw_bytes ]]; then
+		_exit_scsi_debug
+		return $TO_SKIP
+	fi
+
+	port="$(_create_nvmet_port)"
+	_create_nvmet_subsystem --blkdev "/dev/${SCSI_DEBUG_DEVICES[0]}"
+	_add_nvmet_subsys_to_port "${port}" "${def_subsysnqn}"
+
+	_create_nvmet_host "${def_subsysnqn}" "${def_hostnqn}"
+	_nvme_connect_subsys
+
+	echo $(_find_nvme_ns "${def_subsys_uuid}")
+}
+
+cleanup_test_device() {
+	_nvme_disconnect_subsys
+	_nvmet_target_cleanup --subsysnqn "${def_subsysnqn}"
+	_exit_scsi_debug
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	_setup_nvmet
+
+	# disable WRITE SAME with unmap
+	local dname
+	dname=$(setup_test_device lbprz=0)
+	ret=$?
+	if ((ret)); then
+		if ((ret == TO_SKIP)); then
+			SKIP_REASONS+=("kernel does not support unmap write zeroes sysfs interface")
+		fi
+		return 1
+	fi
+
+	umap_hw_bytes="$(cat "/sys/block/$dname/queue/write_zeroes_unmap_max_hw_bytes")"
+	umap_bytes="$(cat "/sys/block/$dname/queue/write_zeroes_unmap_max_bytes")"
+	if [[ $umap_hw_bytes -ne 0 || $umap_bytes -ne 0 ]]; then
+		echo "Test disable WRITE SAME with unmap failed."
+	fi
+	cleanup_test_device
+
+	# enable WRITE SAME with unmap
+	if ! dname=$(setup_test_device lbprz=1 lbpws=1); then
+		return 1
+	fi
+
+	zero_bytes="$(cat "/sys/block/$dname/queue/write_zeroes_max_bytes")"
+	umap_hw_bytes="$(cat "/sys/block/$dname/queue/write_zeroes_unmap_max_hw_bytes")"
+	umap_bytes="$(cat "/sys/block/$dname/queue/write_zeroes_unmap_max_bytes")"
+	if [[ $umap_hw_bytes -ne $zero_bytes || $umap_bytes -ne $zero_bytes ]]; then
+		echo "Test enable WRITE SAME with unmap failed."
+	fi
+
+	echo 0 > "/sys/block/$dname/queue/write_zeroes_unmap_max_bytes"
+	umap_bytes="$(cat "/sys/block/$dname/queue/write_zeroes_unmap_max_bytes")"
+	if [[ $umap_bytes -ne 0 ]]; then
+		echo "Test manually disable WRITE SAME with unmap failed."
+	fi
+	cleanup_test_device
+
+	echo "Test complete"
+}
diff --git a/tests/nvme/065.out b/tests/nvme/065.out
new file mode 100644
index 0000000..262cfc9
--- /dev/null
+++ b/tests/nvme/065.out
@@ -0,0 +1,4 @@
+Running nvme/065
+disconnected 1 controller(s)
+disconnected 1 controller(s)
+Test complete
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH blktests v2 0/3] blktest: add unmap write zeroes tests
  2025-08-13  2:44 [PATCH blktests v2 0/3] blktest: add unmap write zeroes tests Zhang Yi
                   ` (2 preceding siblings ...)
  2025-08-13  2:44 ` [PATCH blktests v2 3/3] nvme/065: " Zhang Yi
@ 2025-08-17  6:14 ` Shinichiro Kawasaki
  2025-08-18  1:42   ` Zhang Yi
  3 siblings, 1 reply; 6+ messages in thread
From: Shinichiro Kawasaki @ 2025-08-17  6:14 UTC (permalink / raw)
  To: Zhang Yi
  Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org,
	dm-devel@lists.linux.dev, linux-nvme@lists.infradead.org,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, hch,
	tytso@mit.edu, djwong@kernel.org, bmarzins@redhat.com,
	chaitanyak@nvidia.com, brauner@kernel.org,
	martin.petersen@oracle.com, yi.zhang@huawei.com,
	chengzhihao1@huawei.com, yukuai3@huawei.com, yangerkun@huawei.com

On Aug 13, 2025 / 10:44, Zhang Yi wrote:
> From: Zhang Yi <yi.zhang@huawei.com>
> 
> Change since v2:
>  - Modify the sysfs interfaces according to the kernel implementation.
>  - Determine whether the kernel supports it by directly checking the
>    existence of the sysfs interface, instead of using device_requries(). 
>  - Drop _short_dev() helper and directly use _real_dev() to acquire dm
>    path.
>  - Check the return value of setup_test_device().
>  - Fix the '"make check'" errors.
> 
> 
> The Linux kernel (since version 6.17)[1] supports FALLOC_FL_WRITE_ZEROES
> in fallocate(2) and add max_{hw|user}_wzeroes_unmap_sectors parameters
> to the block device queue limit. These tests test those block device
> unmap write zeroes sysfs interface
> 
>         /sys/block/<disk>/queue/write_zeroes_max_bytes
>         /sys/block/<disk>/queue/write_zeroes_unmap_max_hw_bytes
> 
> with various SCSI/NVMe/device-mapper devices.
> 
> The value of /sys/block//queue/write_zeroes_unmap_max_hw_bytes should be
> equal to a nonzero value of /sys/block//queue/write_zeroes_max_bytes if
> the block device supports the unmap write zeroes command; otherwise, it
> should return 0. We can also disable unmap write zeroes command by
> setting /sys/block/<disk>/queue/write_zeroes_max_bytes to 0.
> 
>  - scsi/010 test SCSI devices.
>  - dm/003 test device mapper stacked devices.
>  - nvme/065 test NVMe devices.
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=278c7d9b5e0c

I applied this v2 series. Of note is that I amended the 2nd and 3rd patches to
fix the shellcheck warnings below. Anyway, thanks for the patches!

$ make check
shellcheck -x -e SC2119 -f gcc check common/* \
        tests/*/rc tests/*/[0-9]*[0-9] src/*.sh
common/rc:679:7: note: Double quote to prevent globbing and word splitting. [SC2086]
tests/nvme/065:44:7: warning: Quote this to prevent word splitting. [SC2046]
tests/nvme/065:44:7: note: Useless echo? Instead of 'echo $(cmd)', just use 'cmd'. [SC2005]
make: *** [Makefile:21: check] Error 1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH blktests v2 0/3] blktest: add unmap write zeroes tests
  2025-08-17  6:14 ` [PATCH blktests v2 0/3] blktest: " Shinichiro Kawasaki
@ 2025-08-18  1:42   ` Zhang Yi
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang Yi @ 2025-08-18  1:42 UTC (permalink / raw)
  To: Shinichiro Kawasaki
  Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org,
	dm-devel@lists.linux.dev, linux-nvme@lists.infradead.org,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, hch,
	tytso@mit.edu, djwong@kernel.org, bmarzins@redhat.com,
	chaitanyak@nvidia.com, brauner@kernel.org,
	martin.petersen@oracle.com, yi.zhang@huawei.com,
	chengzhihao1@huawei.com, yukuai3@huawei.com, yangerkun@huawei.com

On 8/17/2025 2:14 PM, Shinichiro Kawasaki wrote:
> On Aug 13, 2025 / 10:44, Zhang Yi wrote:
>> From: Zhang Yi <yi.zhang@huawei.com>
>>
>> Change since v2:
>>  - Modify the sysfs interfaces according to the kernel implementation.
>>  - Determine whether the kernel supports it by directly checking the
>>    existence of the sysfs interface, instead of using device_requries(). 
>>  - Drop _short_dev() helper and directly use _real_dev() to acquire dm
>>    path.
>>  - Check the return value of setup_test_device().
>>  - Fix the '"make check'" errors.
>>
>>
>> The Linux kernel (since version 6.17)[1] supports FALLOC_FL_WRITE_ZEROES
>> in fallocate(2) and add max_{hw|user}_wzeroes_unmap_sectors parameters
>> to the block device queue limit. These tests test those block device
>> unmap write zeroes sysfs interface
>>
>>         /sys/block/<disk>/queue/write_zeroes_max_bytes
>>         /sys/block/<disk>/queue/write_zeroes_unmap_max_hw_bytes
>>
>> with various SCSI/NVMe/device-mapper devices.
>>
>> The value of /sys/block//queue/write_zeroes_unmap_max_hw_bytes should be
>> equal to a nonzero value of /sys/block//queue/write_zeroes_max_bytes if
>> the block device supports the unmap write zeroes command; otherwise, it
>> should return 0. We can also disable unmap write zeroes command by
>> setting /sys/block/<disk>/queue/write_zeroes_max_bytes to 0.
>>
>>  - scsi/010 test SCSI devices.
>>  - dm/003 test device mapper stacked devices.
>>  - nvme/065 test NVMe devices.
>>
>> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=278c7d9b5e0c
> 
> I applied this v2 series. Of note is that I amended the 2nd and 3rd patches to
> fix the shellcheck warnings below. Anyway, thanks for the patches!
> 
> $ make check
> shellcheck -x -e SC2119 -f gcc check common/* \
>         tests/*/rc tests/*/[0-9]*[0-9] src/*.sh
> common/rc:679:7: note: Double quote to prevent globbing and word splitting. [SC2086]
> tests/nvme/065:44:7: warning: Quote this to prevent word splitting. [SC2046]
> tests/nvme/065:44:7: note: Useless echo? Instead of 'echo $(cmd)', just use 'cmd'. [SC2005]
> make: *** [Makefile:21: check] Error 1

Sorry for missing these warnings, and thank you for fixing them! :-)

Thanks.
Yi.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-08-18  1:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13  2:44 [PATCH blktests v2 0/3] blktest: add unmap write zeroes tests Zhang Yi
2025-08-13  2:44 ` [PATCH blktests v2 1/3] scsi/010: " Zhang Yi
2025-08-13  2:44 ` [PATCH blktests v2 2/3] dm/003: " Zhang Yi
2025-08-13  2:44 ` [PATCH blktests v2 3/3] nvme/065: " Zhang Yi
2025-08-17  6:14 ` [PATCH blktests v2 0/3] blktest: " Shinichiro Kawasaki
2025-08-18  1:42   ` Zhang Yi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).