Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp319095ybv; Thu, 6 Feb 2020 23:44:57 -0800 (PST) X-Google-Smtp-Source: APXvYqxjdlS6kXwbG5579gdnET8Vt5VV3FLUIqBK5SF3rl8IOedJW2zt632kVwnyOGD/o8wIgUjC X-Received: by 2002:aca:3f43:: with SMTP id m64mr1176643oia.165.1581061497340; Thu, 06 Feb 2020 23:44:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581061497; cv=none; d=google.com; s=arc-20160816; b=T+BAjAlOrzUrrm8hbBtfXkits/UZV/KNY31klQFAaHb8/vr9xlkipJohfpIyJyD9UB 6k7VxozX11HiMjOOlpcmsRDbkO3B44utguCB/Tq8ZNz/XOmeKr6QaRq+AvQE+oGsMg9C iUEHRvr/Z8DCOlPviueu0nF67Lc57y8Ug7JfFbSvsgKKFdfO/6M5Dc2kRfK3CUsgIX3/ MVcJdmkeT3DteLQB59ClBJ6TSdD2gtWl/shYRtAH6hhWxm0nbhNo0O3bUkNXlc1l4osg 9KpyLGqQ+IXNgbDY0j5p7ysfKjl1W7+6UQTSm75yyoPFyI49gAM9amLHLzjm+hnGJGpG KFeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=7K/8s/w5o7WtszbuFYnczji21bwL9l/Yy+4VjqLHvNM=; b=mBKA5V/DkY4RwFQnvt+vgtzpZsJNgTYQ4r2NHmN+z83kOvXB2WiSwClV+yQHorMA8D oNjXWoD/CqbK+zBlYBw7kyiZpQhQKX4PuY5KS8du5pxuXnoO/9HJUexhoHOYFPeU5Teh 1W62HilQ/PhY7RmzFzd2BlSdyRvDjONM1MZhazjJ0B6EyeDfSFg9JaLoEtuFM68Q5eUk n1LGNIyOpc2yBAOaiXinUuP1IYoHfIw4UUKZYghvbrKTnb+WC5pFalWcMFaa53SzwAc9 drxwiPziFq6O5K3PxCppd4BV3kUfd86IlT+sej4L25V5i/j2ryuqg2w32UzNvVtcBNLK nFyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si3667289oie.196.2020.02.06.23.44.45; Thu, 06 Feb 2020 23:44:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726626AbgBGHnq (ORCPT + 99 others); Fri, 7 Feb 2020 02:43:46 -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