Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11873857rwl; Tue, 3 Jan 2023 06:04:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXtMEylMKmRFjfsBsRA7hs8yubIKTyCZgyb1u/8vsMYWKL4BG/VZpTo3Ik81KWZpIclE8If0 X-Received: by 2002:a17:907:a707:b0:7c1:75e9:1180 with SMTP id vw7-20020a170907a70700b007c175e91180mr39109451ejc.22.1672754684394; Tue, 03 Jan 2023 06:04:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672754684; cv=none; d=google.com; s=arc-20160816; b=EaaquGUWi52z9ZvK1EynZAjQPgvUA1UxZ/hn26hyLC4LzJYQrLLJGTZBbeyDF7og0a Q8+aNIkKyhe0CjHmSIPR0JmSNxU4xshp3Z7h5TG8HXiOcd5U3wbRo/WLYsAeja7w6rDX D01GvE9rUlNy/VT9hhH2Y9P2vlom9W/WGH59aZNZCiLiOYo2nCNPOQK+X5peGvlepm2p P+mOSQoLveoN2tyXGxAC23kPpcj9X8yfwKSssVdNuDZFBfYY+FvhpzWFXwgSMng+vhZb aWYwBk6DFi6GOqsen86qJFckp5noynYHniA4giKj9LXIUZJ9VkWO7ICjKMMmMhLi18c6 T+jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=rAcxMAKJNRiN8Bk3atXFvfIisLL3QxgCrRf05TmHA2I=; b=r7VcWvbrFDAlryFHlcKlc/mlpZ8nG7YgYdAn/2r0s+OtE56nnsU28OSlRS3jdVj/8O NQ1ugTOR3aeMJf5oeJ732tuxeyU7Sv/CDzClvgLabuGyiLxbbnQTOkTd2qGLz5BIWZUB nPNi2Wy+2U5RAHJlqZTVLS9+QnnFqGDcR2bGY26FxYsWoRTQp9L+hw+tvzwaVSa0punG Qb7nGwsAZDLaSibok4c15WI+OE4ginpYJsPhBi+YKj/J7Hq0j8lsBzjgNDmlBb27YhgK 3bFVQ+nTZClfLijN+R8lrigfcVUMXCzoS5hj/oSv/SKDeA+Ijshs0Rx2Unhi3zwkXYT5 MqHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=N1ea1Fnr; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g19-20020a1709065d1300b007c0eb33879asi28895595ejt.667.2023.01.03.06.04.30; Tue, 03 Jan 2023 06:04:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=N1ea1Fnr; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237423AbjACNpG (ORCPT + 60 others); Tue, 3 Jan 2023 08:45:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237375AbjACNpE (ORCPT ); Tue, 3 Jan 2023 08:45:04 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B7A51114A for ; Tue, 3 Jan 2023 05:45:03 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1672753501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rAcxMAKJNRiN8Bk3atXFvfIisLL3QxgCrRf05TmHA2I=; b=N1ea1Fnra/MBqhoT8H2zCLgdgV1iSYTwdMAyPAJkFgWWYNkh2hci5t7ttXUBMcUAVPF0Xi ck98MRv15+4dFlNP7pZCIAA8cIc2X6JimARsE+U/wniBC8qN+0Cs8Nt7eVNV5oZT+Q9mL6 1fMmQSdjpPLaMgR7HkHAraVNqrq0cVjFJSoPOBbwP/0YohURfKPWqptkG47Ca8KKEQfNfA k+Pxbq+AKTFpboyprV8NsOBANWmnw79UJZ8W3DQIF6BKhZD/K6Hpge+pmahP6Kzc8rqbIO qjbgVkQQqp2o8os00S+XY/56xp0DYPCsdgLZMkB2z4lOOJUg6KrIJW88HT4SwA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1672753501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rAcxMAKJNRiN8Bk3atXFvfIisLL3QxgCrRf05TmHA2I=; b=vtaqMSM9L1ZY4vLO30KhOGEb2eOw2Aoh3hjYS0+BSVQDUScKMPw6w9At4dWl8YeDEpIO4B db+JHH/TgSB+bkCQ== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH printk v3 6/6] printk: introduce console_prepend_dropped() for dropped messages In-Reply-To: References: <20221221202704.857925-1-john.ogness@linutronix.de> <20221221202704.857925-7-john.ogness@linutronix.de> <87y1qjdimw.fsf@jogness.linutronix.de> Date: Tue, 03 Jan 2023 14:50:23 +0106 Message-ID: <87o7rfd96w.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-01-03, Petr Mladek wrote: > Well, what about making sure that something more useful is always > printed. For example: > > /* > * Make sure outbuf is sufficiently large before prepending. > * Keep at least the prefix when the message has to be truncated. > * It is a rather theoretical problem when someone tries to > * use a minimalist buffer. > */ > if (WARN_ON_ONCE(len + PREFIX_MAX + 1 >= outbuf_sz)) > return; I am fine with this. We won't see this warning anyway. Few lines would ever be printed correctly if anyone ever tries to use a buffer so small. > If we want to use this way. It would probably make sense to > rename PREFIX_MAX to CONSOLE_PREFIX_MAX. Actually, I would like to rename all of those limit macros to something that makes more sense for the new code base: CONSOLE_EXT_LOG_MAX -> CONSOLE_MESSAGE_MAX CONSOLE_LOG_MAX -> SYSLOG_MESSAGE_MAX LOG_LINE_MAX -> PRINTK_RECORD_MAX PREFIX_MAX -> CONSOLE_PREFIX_MAX I have a patch to do this ready, but I did not want to post it until we are finished with the thread/atomic work. John