new file mode 100755
@@ -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 titled ("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"
+}
new file mode 100644
@@ -0,0 +1,2 @@
+Running block/039
+Test complete
The new large sector support in the kernel version 6.15-rcX caused kernel crash due to race between set_blocksize and read paths [1]. Add a test case to trigger the crash and confirm its fix. Link: [1] https://lore.kernel.org/linux-block/20250415001405.GA25659@frogsfrogsfrogs/ Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> --- The test case number block/039 conflicts with the test case in Ming's recent patch. I will renumber this test case or Ming's test case when I apply it, depending on the order of patch application. tests/block/039 | 54 +++++++++++++++++++++++++++++++++++++++++++++ tests/block/039.out | 2 ++ 2 files changed, 56 insertions(+) create mode 100755 tests/block/039 create mode 100644 tests/block/039.out