Re: [PATCH net-next v3 06/10] net: netconsole: track explicitly if msgbody was written to buffer
From: Jakub Kicinski <kuba@kernel.org>
Date: 2024-09-15 15:00:20
Also in:
lkml
From: Jakub Kicinski <kuba@kernel.org>
Date: 2024-09-15 15:00:20
Also in:
lkml
On Tue, 10 Sep 2024 03:04:01 -0700 Breno Leitao wrote:
@@ -1128,6 +1128,7 @@ static void send_msg_fragmented(struct netconsole_target *nt, */ while (offset < body_len) { int this_header = header_len; + bool msgbody_written = false; int this_offset = 0; int this_chunk = 0;@@ -1146,12 +1147,22 @@ static void send_msg_fragmented(struct netconsole_target *nt, this_offset += this_chunk; } + if (offset + this_offset >= msgbody_len) + /* msgbody was finally written, either in the previous + * messages and/or in the current buf. Time to write + * the userdata. + */ + msgbody_written = true;
nit: this could be: msgbody_written |= offset + this_offset >= msgbody_len; ?