Re: [PATCH 1/2] tracing/selftests: Fix instance test to actually test races

From
Steven Rostedt <rostedt@kernel.org>
Date
2026-10-30 01:21:11
Also in
linux-kselftest, lkml
Reply to
Masami Hiramatsu (Google), 2026-10-30
On Fri, 30 Oct 2026 10:01:19 +0900
"Masami Hiramatsu (Google)" [off-list ref] wrote:
quoted
 instance_slam() {
-        while :; do
-                mkdir foo 2> /dev/null
-                rmdir foo 2> /dev/null
-        done
+	mkdir foo 2> /dev/null
+	while ! rmdir foo; do
+		echo could not rmdir foo  
nit: If we retry this, do we need to warn it?
(maybe we can add a limitation of continuous failure and make the
test fail if the failure exceeds it.)
Retrying is actually quite normal. The rmdir *should* fail if one of
the instance files is open.

Now perhaps we can add a counter to make it fail if it exceeds a large
threshold?

	let x=0
	while ! rmdir  foo; do
		let x=$x+1
		if [ $x -gt 10000 ]; then
			exit_fail
		fi
	done

?

-- Steve
Thread (6 messages) 6 messages, 2 authors, last reply 13d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help