Patch "selftests/ftrace: Fix eventfs ownership testcase to find mount point" has been added to the 6.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    selftests/ftrace: Fix eventfs ownership testcase to find mount point

to the 6.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     selftests-ftrace-fix-eventfs-ownership-testcase-to-f.patch
and it can be found in the queue-6.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3dab0a66a7dacab71f0b481a0fa47617bf071827
Author: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
Date:   Thu Sep 5 00:30:21 2024 +0900

    selftests/ftrace: Fix eventfs ownership testcase to find mount point
    
    [ Upstream commit f0a6ecebd858658df213d114b0530f8f0b96e396 ]
    
    Fix eventfs ownership testcase to find mount point if stat -c "%m" failed.
    This can happen on the system based on busybox. In this case, this will
    try to use the current working directory, which should be a tracefs top
    directory (and eventfs is mounted as a part of tracefs.)
    If it does not work, the test is skipped as UNRESOLVED because of
    the environmental problem.
    
    Fixes: ee9793be08b1 ("tracing/selftests: Add ownership modification tests for eventfs")
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
    Acked-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
    Signed-off-by: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc b/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
index c45094d1e1d2d..803efd7b56c77 100644
--- a/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
+++ b/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
@@ -6,6 +6,18 @@ original_group=`stat -c "%g" .`
 original_owner=`stat -c "%u" .`
 
 mount_point=`stat -c '%m' .`
+
+# If stat -c '%m' does not work (e.g. busybox) or failed, try to use the
+# current working directory (which should be a tracefs) as the mount point.
+if [ ! -d "$mount_point" ]; then
+	if mount | grep -qw $PWD ; then
+		mount_point=$PWD
+	else
+		# If PWD doesn't work, that is an environmental problem.
+		exit_unresolved
+	fi
+fi
+
 mount_options=`mount | grep "$mount_point" | sed -e 's/.*(\(.*\)).*/\1/'`
 
 # find another owner and group that is not the original




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux