diff mbox series

[2/2] generic: new test which tests for an io_uring bug that causes umounts to fail

Message ID 20240613221810.803463-2-tytso@mit.edu (mailing list archive)
State New
Headers show
Series [1/2] generic/269, generic/475: disable io_uring to prevent umount EBUSY flakes | expand

Commit Message

Theodore Ts'o June 13, 2024, 10:18 p.m. UTC
Test for an I/O uring bug which holds on to a file reference after the
userspace program exits.

Link: https://lore.kernel.org/fstests/20230831151837.qexyqjgvrllqaz26@zlang-mailbox/
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 tests/generic/750     | 61 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/750.out |  2 ++
 2 files changed, 63 insertions(+)
 create mode 100755 tests/generic/750
 create mode 100644 tests/generic/750.out
diff mbox series

Patch

diff --git a/tests/generic/750 b/tests/generic/750
new file mode 100755
index 000000000..b45df86b5
--- /dev/null
+++ b/tests/generic/750
@@ -0,0 +1,61 @@ 
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
+#
+# FSQA Test No. 750
+#
+# Run fsstress ; umount to check for EBUSY errors when io_uring is enabled
+# For more information see:
+#    https://lore.kernel.org/fstests/20230831151837.qexyqjgvrllqaz26@zlang-mailbox/
+#
+#
+. ./common/preamble
+_begin_fstest auto rw io_uring stress
+
+# Import common functions.
+. ./common/filter
+# Disable all sync operations to get higher load
+FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0"
+
+_workout()
+{
+	num_iterations=30
+	out=$SCRATCH_MNT/fsstress.$$
+	args=`_scale_fsstress_args -p128 -n1000 -f setattr=1 $FSSTRESS_AVOID -d $out`
+	for ((i=0; i < num_iterations; i++))
+	do
+	    $FSSTRESS_PROG $args &>> $seqres.full &
+	    pid=$!
+	    sleep 1
+	    kill $pid >> $seqres.full 2>&1
+	    wait $pid
+	    if ! _scratch_unmount; then
+		echo "failed to umount"
+		status=1
+		exit
+	    fi
+	    _scratch_mount
+	done
+}
+
+# real QA test starts here
+_supported_fs generic
+_require_scratch
+_require_io_uring
+
+_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1
+_scratch_mount
+
+if ! _workout; then
+	_scratch_unmount 2>/dev/null
+	exit
+fi
+
+if ! _scratch_unmount; then
+	echo "failed to umount"
+	status=1
+	exit
+fi
+status=0
+echo "Silence is golden"
+exit
diff --git a/tests/generic/750.out b/tests/generic/750.out
new file mode 100644
index 000000000..bd79507b6
--- /dev/null
+++ b/tests/generic/750.out
@@ -0,0 +1,2 @@ 
+QA output created by 750
+Silence is golden