Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1639994ybv; Fri, 21 Feb 2020 00:49:19 -0800 (PST) X-Google-Smtp-Source: APXvYqzbI3U8a+yfcDPSbwAyMB5GclyAK2+27O2cavJVHOG807cvqEg11B/FoTHzt6pu6+Db4oPU X-Received: by 2002:a05:6808:98e:: with SMTP id a14mr1053403oic.8.1582274959738; Fri, 21 Feb 2020 00:49:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582274959; cv=none; d=google.com; s=arc-20160816; b=b/Gaciiuss+cDZ6LERRb13sb48PNY5WkFUgOs4v9Kht/CeOD3ctvIxtNAzaWz9JHf7 Jl2pAkM1fO/flq83OzO7aelWBUUueFDHdCECyZLqfeO21+6dqbVlj6IdjjenOnOXqzr/ Me7wWmrtRG2fa2AyPd19jE0kTmhtUpI0Z1zCg1KX4VKytylREjVMaYKmxpX2DkvQOOc0 MmiIY0S8RikGxKYH6PXjhVSMGoBjWZUCC7pID91JzVBDzLjXP8K9XW2I1LGtiGLQqnJs MAyjmw3nYxY7wkFyrFGk8utiG74eshq+txCjLa04NYn7BC1Iq53Mh3UNCezrITfrm/K4 fonQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gW8uepS8B8+3prrbPxACu+kpMKsdvo332OaY+ptyhAE=; b=1C4JIKf2VHDhFK6vb5yh5Nolx3s4BG9H69UcELCwJX74HygeSK9zHjzt5Wx9s8Xned lSHw7SgfM+AlWKX2C3Yrjnk26BIsDynlrrUaipoIieey/qVQuIiYpCJxW5F1/VAEtImI MKjfx3VCCIp7zz1g+hLcbLroC+CrIlitFJKK1Z6kndbfZaE12LbeH7ymXhRSP2rn8aqa iYyfyUrDHZOp+CsCUvNwUeKwcZ+rQgjsT+Mohigr3lvFFEH5am1ZkM9pUruwSYSaqpv/ v1hm2qVrH7JasEM7et5yfKJkBqNPjOh99iWGH1LaCFbRWzo/o4T+UngIq1QZVzdH+9RO qkKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sEY+7dzG; 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 x25si455651oie.261.2020.02.21.00.49.08; Fri, 21 Feb 2020 00:49:19 -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; dkim=pass header.i=@kernel.org header.s=default header.b=sEY+7dzG; 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 S1728731AbgBUHqb (ORCPT + 99 others); Fri, 21 Feb 2020 02:46:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:41990 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728126AbgBUHq3 (ORCPT ); Fri, 21 Feb 2020 02:46:29 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6379D207FD; Fri, 21 Feb 2020 07:46:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582271188; bh=T7uWfjRYwYIvMGHvSLHzXsYWS5MRR42vOXJsYdLx2RE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sEY+7dzGPSOP3vLkiPhfP001uRy6E7zj5K/vpzxPiQeaAYYPu5R+CKOzYjHzQuLp7 PyImtUU/LiAOVkeUvUf8XG/4q8G7xlzvgQeebVUt77o7RmCGzqCsa5o8kcRhwpO3bG eG3z6ZsXw6clPmA6we/cEsXbs6oqi3u6qdh6r/Do= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Steven Rostedt , John Ogness , Sergey Senozhatsky , Petr Mladek , Sasha Levin Subject: [PATCH 5.5 035/399] printk: fix exclusive_console replaying Date: Fri, 21 Feb 2020 08:36:00 +0100 Message-Id: <20200221072405.779898046@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072402.315346745@linuxfoundation.org> References: <20200221072402.315346745@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: John Ogness [ Upstream commit def97da136515cb289a14729292c193e0a93bc64 ] Commit f92b070f2dc8 ("printk: Do not miss new messages when replaying the log") introduced a new variable @exclusive_console_stop_seq to store when an exclusive console should stop printing. It should be set to the @console_seq value at registration. However, @console_seq is previously set to @syslog_seq so that the exclusive console knows where to begin. This results in the exclusive console immediately reactivating all the other consoles and thus repeating the messages for those consoles. Set @console_seq after @exclusive_console_stop_seq has stored the current @console_seq value. Fixes: f92b070f2dc8 ("printk: Do not miss new messages when replaying the log") Link: http://lkml.kernel.org/r/20191219115322.31160-1-john.ogness@linutronix.de Cc: Steven Rostedt Cc: linux-kernel@vger.kernel.org Signed-off-by: John Ogness Acked-by: Sergey Senozhatsky Signed-off-by: Petr Mladek Signed-off-by: Sasha Levin --- kernel/printk/printk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 1ef6f75d92f1f..fada22dc4ab6c 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2770,8 +2770,6 @@ void register_console(struct console *newcon) * for us. */ logbuf_lock_irqsave(flags); - console_seq = syslog_seq; - console_idx = syslog_idx; /* * We're about to replay the log buffer. Only do this to the * just-registered console to avoid excessive message spam to @@ -2783,6 +2781,8 @@ void register_console(struct console *newcon) */ exclusive_console = newcon; exclusive_console_stop_seq = console_seq; + console_seq = syslog_seq; + console_idx = syslog_idx; logbuf_unlock_irqrestore(flags); } console_unlock(); -- 2.20.1