]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests/ftrace: Drop invalid top-level local in test_ownership
authorCao Ruichuang <create0818@163.com>
Tue, 7 Apr 2026 10:26:13 +0000 (18:26 +0800)
committerShuah Khan <skhan@linuxfoundation.org>
Wed, 17 Jun 2026 22:27:17 +0000 (16:27 -0600)
test_ownership.tc is sourced by ftracetest under /bin/sh.

The script currently declares mount_point with local at file scope,
which makes /bin/sh abort with "local: not in a function" before the
test can reach the eventfs ownership checks.

Replace the top-level local declaration with a normal shell variable so
kernels that support the gid= tracefs mount option can run the test at
all.

Link: https://lore.kernel.org/r/20260407102613.81419-1-create0818@163.com
Fixes: 8b55572e51805 ("tracing/selftests: Add tracefs mount options test")
Signed-off-by: Cao Ruichuang <create0818@163.com>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc

index e71cc3ad0bdf9a98e08d41d6692f4a2cc2d56aaf..6d00d3c0f493a319e8787b32946ff8334de8f07a 100644 (file)
@@ -6,7 +6,7 @@
 original_group=`stat -c "%g" .`
 original_owner=`stat -c "%u" .`
 
-local mount_point=$(get_mount_point)
+mount_point=$(get_mount_point)
 
 mount_options=$(get_mnt_options "$mount_point")