linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: fstests@vger.kernel.org
Cc: Linux Filesystem Development List <linux-fsdevel@vger.kernel.org>,
	"Theodore Ts'o" <tytso@mit.edu>
Subject: [PATCH 2/2] generic: new test which tests for an io_uring bug that causes umounts to fail
Date: Thu, 13 Jun 2024 18:18:10 -0400	[thread overview]
Message-ID: <20240613221810.803463-2-tytso@mit.edu> (raw)
In-Reply-To: <20240613221810.803463-1-tytso@mit.edu>

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 --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
-- 
2.43.0


  reply	other threads:[~2024-06-13 22:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12 16:29 Flaky test: generic:269 (EBUSY on umount) Theodore Ts'o
2024-06-12 19:41 ` Darrick J. Wong
2024-06-13 21:56   ` Theodore Ts'o
2024-06-13 22:18     ` [PATCH 1/2] generic/269, generic/475: disable io_uring to prevent umount EBUSY flakes Theodore Ts'o
2024-06-13 22:18       ` Theodore Ts'o [this message]
2024-06-14  4:16     ` Flaky test: generic:269 (EBUSY on umount) Darrick J. Wong
2024-06-14 18:27       ` Theodore Ts'o
2024-06-14 20:44         ` Darrick J. Wong
2024-07-12  2:30           ` Theodore Ts'o
2024-08-23  1:16             ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240613221810.803463-2-tytso@mit.edu \
    --to=tytso@mit.edu \
    --cc=fstests@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).