Patch "Revert "tracing/trigger: Fix to return error if failed to alloc snapshot"" has been added to the 5.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

    Revert "tracing/trigger: Fix to return error if failed to alloc snapshot"

to the 5.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:
     revert-tracing-trigger-fix-to-return-error-if-failed.patch
and it can be found in the queue-5.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 f8e3c1cf9e23a256368ca13e52896e719e4d3aae
Author: Siddh Raman Pant <siddh.raman.pant@xxxxxxxxxx>
Date:   Thu Apr 18 18:58:06 2024 +0530

    Revert "tracing/trigger: Fix to return error if failed to alloc snapshot"
    
    This reverts commit 56cfbe60710772916a5ba092c99542332b48e870 which is
    commit 0958b33ef5a04ed91f61cef4760ac412080c4e08 upstream.
    
    The change has an incorrect assumption about the return value because
    in the current stable trees for versions 5.15 and before, the following
    commit responsible for making 0 a success value is not present:
    b8cc44a4d3c1 ("tracing: Remove logic for registering multiple event triggers at a time")
    
    The return value should be 0 on failure in the current tree, because in
    the functions event_trigger_callback() and event_enable_trigger_func(),
    we have:
    
            ret = cmd_ops->reg(glob, trigger_ops, trigger_data, file);
            /*
             * The above returns on success the # of functions enabled,
             * but if it didn't find any functions it returns zero.
             * Consider no functions a failure too.
             */
            if (!ret) {
                    ret = -ENOENT;
    
    Cc: stable@xxxxxxxxxx # 5.15, 5.10, 5.4, 4.19
    Signed-off-by: Siddh Raman Pant <siddh.raman.pant@xxxxxxxxxx>
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
index e4340958da2df..4bc90965abb25 100644
--- a/kernel/trace/trace_events_trigger.c
+++ b/kernel/trace/trace_events_trigger.c
@@ -1140,10 +1140,8 @@ register_snapshot_trigger(char *glob, struct event_trigger_ops *ops,
 			  struct event_trigger_data *data,
 			  struct trace_event_file *file)
 {
-	int ret = tracing_alloc_snapshot_instance(file->tr);
-
-	if (ret < 0)
-		return ret;
+	if (tracing_alloc_snapshot_instance(file->tr) != 0)
+		return 0;
 
 	return register_trigger(glob, ops, data, file);
 }




[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