Patch "net: netconsole: fix wrong warning" has been added to the 6.11-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

    net: netconsole: fix wrong warning

to the 6.11-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:
     net-netconsole-fix-wrong-warning.patch
and it can be found in the queue-6.11 subdirectory.

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



commit 1ff626a095d2098504b19808d53d58629b434619
Author: Breno Leitao <leitao@xxxxxxxxxx>
Date:   Tue Oct 8 02:43:24 2024 -0700

    net: netconsole: fix wrong warning
    
    [ Upstream commit d94785bb46b6167382b1de3290eccc91fa98df53 ]
    
    A warning is triggered when there is insufficient space in the buffer
    for userdata. However, this is not an issue since userdata will be sent
    in the next iteration.
    
    Current warning message:
    
        ------------[ cut here ]------------
         WARNING: CPU: 13 PID: 3013042 at drivers/net/netconsole.c:1122 write_ext_msg+0x3b6/0x3d0
          ? write_ext_msg+0x3b6/0x3d0
          console_flush_all+0x1e9/0x330
    
    The code incorrectly issues a warning when this_chunk is zero, which is
    a valid scenario. The warning should only be triggered when this_chunk
    is negative.
    
    Fixes: 1ec9daf95093 ("net: netconsole: append userdata to fragmented netconsole messages")
    Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
    Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
    Link: https://patch.msgid.link/20241008094325.896208-1-leitao@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 9c09293b52588..3e68f7a6e0abe 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -1118,8 +1118,14 @@ static void send_ext_msg_udp(struct netconsole_target *nt, const char *msg,
 
 			this_chunk = min(userdata_len - sent_userdata,
 					 MAX_PRINT_CHUNK - preceding_bytes);
-			if (WARN_ON_ONCE(this_chunk <= 0))
+			if (WARN_ON_ONCE(this_chunk < 0))
+				/* this_chunk could be zero if all the previous
+				 * message used all the buffer. This is not a
+				 * problem, userdata will be sent in the next
+				 * iteration
+				 */
 				return;
+
 			memcpy(buf + this_header + this_offset,
 			       userdata + sent_userdata,
 			       this_chunk);




[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