From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DECC1C2D0B1 for ; Fri, 7 Feb 2020 07:43:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B271021741 for ; Fri, 7 Feb 2020 07:43:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726861AbgBGHnr (ORCPT ); Fri, 7 Feb 2020 02:43:47 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:39155 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgBGHnq (ORCPT ); Fri, 7 Feb 2020 02:43:46 -0500 Received: from localhost ([127.0.0.1] helo=vostro.local) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1izyIf-00071r-RG; Fri, 07 Feb 2020 08:43:41 +0100 From: John Ogness To: Steven Rostedt Cc: Sergey Senozhatsky , Sergey Senozhatsky , lijiang , Petr Mladek , Peter Zijlstra , Linus Torvalds , Greg Kroah-Hartman , Andrea Parri , Thomas Gleixner , kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/2] printk: replace ringbuffer References: <20200128161948.8524-1-john.ogness@linutronix.de> <20200205044848.GH41358@google.com> <20200205050204.GI41358@google.com> <88827ae2-7af5-347b-29fb-cffb94350f8f@redhat.com> <20200205063640.GJ41358@google.com> <877e11h0ir.fsf@linutronix.de> <20200205110522.GA456@jagdpanzerIV.localdomain> <87wo919grz.fsf@linutronix.de> <20200206204012.0cbfc941@oasis.local.home> Date: Fri, 07 Feb 2020 08:43:39 +0100 In-Reply-To: <20200206204012.0cbfc941@oasis.local.home> (Steven Rostedt's message of "Thu, 6 Feb 2020 20:40:12 -0500") Message-ID: <87k14yx2ok.fsf@linutronix.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-02-07, Steven Rostedt wrote: >> The quick fixup: >> >> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c >> index d0d24ee1d1f4..5ad67ff60cd9 100644 >> --- a/kernel/printk/printk.c >> +++ b/kernel/printk/printk.c >> @@ -883,6 +883,7 @@ static int devkmsg_open(struct inode *inode, struct file *file) >> user->record.text_buf_size = sizeof(user->text_buf); >> user->record.dict_buf = &user->dict_buf[0]; >> user->record.dict_buf_size = sizeof(user->dict_buf); >> + user->record.text_line_count = NULL; >> >> logbuf_lock_irq(); >> user->seq = prb_first_seq(prb); > > FYI, I used your patch set to test out Konstantin's new get-lore-mbox > script, and then applied them. It locked up on boot up as well, and > applying this appears to fix it. Yes, this is a horrible bug. In preparation for my v2 I implemented: prb_rec_init_rd() prb_rec_init_wr() as static inline functions to initialize the records. There is a reader and writer variant because they initialize the records differently: readers provide buffers, writers request buffers. This eliminates the manual twiddling with the record struct and ensures that the struct is always properly initialized. John Ogness