From: "Banerjee, Debabrata" <dbanerje@akamai.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Jeff Mahoney <jeffm@suse.com>,
"dbavatar@gmail.com" <dbavatar@gmail.com>,
"Hunt, Joshua" <johunt@akamai.com>,
stable <stable@vger.kernel.org>
Subject: Re: [PATCH] printk: Fix discarding of records
Date: Sun, 16 Feb 2014 19:19:41 -0500 [thread overview]
Message-ID: <CF26BC6D.2E80E%dbanerje@akamai.com> (raw)
In-Reply-To: <CA+55aFyiEcMBegoypWVTZXnb4aLj1PD4FRHWV83X2DY=8VHz7w@mail.gmail.com>
On 2/16/14, 6:59 PM, "Linus Torvalds" <torvalds@linux-foundation.org>
wrote:
>On Sun, Feb 16, 2014 at 3:23 PM, Banerjee, Debabrata
><dbanerje@akamai.com> wrote:
>>
>> The explanation is: the loops look identical but they are not. When a
>> record is printed first, its size can expand due to adding the prefix
>>and
>> timestamp. The second loop is calculating len with the first line
>>printed
>> possibly changing every iteration.
>
>That still makes zero sense.
>
>The size should damn well not change, because we *should* be calling
>it with the exact same flags. If the size changes, something is wrong.
The problem is that it starts discarding records from the top of the list,
and the size of the first line is based on the previous line. When we
discard the *first* line off the list, then the size of the next line can
change since it is the new first line. My v1 patch was flawed because it
didn't consider just the first line.
>So my suspicion is that the *real* bug is that
>
> prev = 0;
>
>before that *third* loop, because it means that the first time through
>that loop (when we did *not* reset "seq/idx" to the beginning, we use
>the wrong "prev" value.
No that can't be right, the prev value after every loop is the msg->flags
from the *last* line in the list, which has no relation to the *first*, so
reusing it for the top of the next loop is nonsense. seq is not reset
because the second loop seeks to the seq where the third loop starts
printing.
I think I really fixed it properly with my v2 patch, please take a look.
-Debabrata
next prev parent reply other threads:[~2014-02-17 0:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-14 4:42 Debabrata Banerjee
2014-02-16 19:28 ` Linus Torvalds
2014-02-16 20:47 ` Greg Kroah-Hartman
2014-02-16 23:05 ` Kay Sievers
2014-02-16 23:23 ` Banerjee, Debabrata
2014-02-16 23:59 ` Linus Torvalds
2014-02-17 0:19 ` Banerjee, Debabrata [this message]
2014-02-17 0:41 ` Linus Torvalds
2014-02-17 0:50 ` Kay Sievers
2014-02-17 0:57 ` Linus Torvalds
2014-02-17 1:19 ` Kay Sievers
2014-02-17 1:41 ` Kay Sievers
2014-02-17 2:38 ` Banerjee, Debabrata
2014-03-21 15:18 ` Josh Hunt
2014-03-21 15:33 ` Greg Kroah-Hartman
2014-02-16 23:24 ` [PATCH v2] " Debabrata Banerjee
2014-02-17 0:42 ` [PATCH v3] " Debabrata Banerjee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CF26BC6D.2E80E%dbanerje@akamai.com \
--to=dbanerje@akamai.com \
--cc=dbavatar@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jeffm@suse.com \
--cc=johunt@akamai.com \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®