Patch "blktrace: Fix output non-blktrace event when blk_classic option enabled" has been added to the 6.0-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

    blktrace: Fix output non-blktrace event when blk_classic option enabled

to the 6.0-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:
     blktrace-fix-output-non-blktrace-event-when-blk_clas.patch
and it can be found in the queue-6.0 subdirectory.

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



commit 8103c0b56366884f01997ee98474326b813ad0cd
Author: Yang Jihong <yangjihong1@xxxxxxxxxx>
Date:   Tue Nov 22 12:04:10 2022 +0800

    blktrace: Fix output non-blktrace event when blk_classic option enabled
    
    [ Upstream commit f596da3efaf4130ff61cd029558845808df9bf99 ]
    
    When the blk_classic option is enabled, non-blktrace events must be
    filtered out. Otherwise, events of other types are output in the blktrace
    classic format, which is unexpected.
    
    The problem can be triggered in the following ways:
    
      # echo 1 > /sys/kernel/debug/tracing/options/blk_classic
      # echo 1 > /sys/kernel/debug/tracing/events/enable
      # echo blk > /sys/kernel/debug/tracing/current_tracer
      # cat /sys/kernel/debug/tracing/trace_pipe
    
    Fixes: c71a89615411 ("blktrace: add ftrace plugin")
    Signed-off-by: Yang Jihong <yangjihong1@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221122040410.85113-1-yangjihong1@xxxxxxxxxx
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 7f5eb295fe19..ee22a3b1c181 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -1546,7 +1546,8 @@ blk_trace_event_print_binary(struct trace_iterator *iter, int flags,
 
 static enum print_line_t blk_tracer_print_line(struct trace_iterator *iter)
 {
-	if (!(blk_tracer_flags.val & TRACE_BLK_OPT_CLASSIC))
+	if ((iter->ent->type != TRACE_BLK) ||
+	    !(blk_tracer_flags.val & TRACE_BLK_OPT_CLASSIC))
 		return TRACE_TYPE_UNHANDLED;
 
 	return print_one_line(iter, true);



[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