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=-13.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 8A28CC2D0E3 for ; Tue, 15 Sep 2020 22:30:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5762120B1F for ; Tue, 15 Sep 2020 22:30:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727409AbgIOQRe (ORCPT ); Tue, 15 Sep 2020 12:17:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:36412 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727451AbgIOPZ1 (ORCPT ); Tue, 15 Sep 2020 11:25:27 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 969EDAC1D; Tue, 15 Sep 2020 15:25:15 +0000 (UTC) Date: Tue, 15 Sep 2020 17:24:41 +0200 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] printk: ringbuffer: fix setting state in desc_read() Message-ID: <20200915152441.GB11813@alley> References: <20200914094803.27365-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200914094803.27365-1-john.ogness@linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 2020-09-14 11:54:02, John Ogness wrote: > It is expected that desc_read() will always set at least the > @state_var field. However, if the descriptor is in an inconsistent > state, no fields are set. > > Also, the second load of @state_var is not stored in @desc_out and > so might not match the state value that is returned. > > Always set the last loaded @state_var into @desc_out, regardless of > the descriptor consistency. > > Fixes: b6cf8b3f3312 ("printk: add lockless ringbuffer") > Signed-off-by: John Ogness Both patches are committed into printk/linux.git, branch printk-rework. Best Regards, Petr