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=-6.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 A8E22C56202 for ; Thu, 12 Nov 2020 05:44:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 49A422076E for ; Thu, 12 Nov 2020 05:44:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Tdb4UZpb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728163AbgKLFdQ (ORCPT ); Thu, 12 Nov 2020 00:33:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729613AbgKLBq0 (ORCPT ); Wed, 11 Nov 2020 20:46:26 -0500 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1719C0613D4 for ; Wed, 11 Nov 2020 17:45:51 -0800 (PST) Received: by mail-pf1-x443.google.com with SMTP id a18so3023431pfl.3 for ; Wed, 11 Nov 2020 17:45:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=GQhUQl5SKV0omnprfPWc5RGNu6gDlIOdHOTSpdoTP04=; b=Tdb4UZpbGfvRJjebuFXiO/6BMdhzJfVunPRmsZ670eeHqce5TISfTRxDDvIoE0zT+R r0TlPQU2ZoLltpxscmIni/gkJupd810wxmz+SPIRg7WuSw1n7eM7iE3pO26Qy35hiWtL MX/edmWzb1ZDUKD9pOEDSklGXnptDHZObeGLo7z+sTgv7CnEIcpOsAslsm5JWglaqr3S KzwTajEjlWbe5K0S8OOsXFHt+V0mZZBDElH9t8dAro0loM6yhx5XpnPQSfFwCSCzLUlE GBOAxMVgxA0+h0jfvcHvg3zj/7vmyhcfyBlOW6iPlcObtIzPfWUAvfmOPRgTj8fZ4d6n 8RzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=GQhUQl5SKV0omnprfPWc5RGNu6gDlIOdHOTSpdoTP04=; b=VNrbOzd6p6BFMdIqq12Y05Eujnj/v+yixmWEEyIbovlsloTOHJhOEwcfMB9/mHLyiU 3GWgauotZYLPRQ7d0Gw2aBxHQe/H+RWpHpKMnfxtvLwgoUJHX6rbxfwNqw+WG5hi24RU iHUkTper1iTDQAGHA09cy2oM2DJc0B4nDAZnGm8jt/FsmhmxNTF0Xj5aftOov8IMbXjk nQcSAbNFTn5uI7fb96PrvLL2NnjxGxESXjKA4F31+wEo+vVtiqadt7Eos3oDC8biipzb kRdBPmiGVBFHHx1DTnKIioJEndPTff+2z/iljFHvVLrLROPvQjcO1WF6vta82a/WSXrZ WZnw== X-Gm-Message-State: AOAM5339U+EU5dkqbLBHK/9JhS8h8TMPbzNIkSm/4s264J6a98KP9j2u YQ3FyvXyNmSRpVdh87iQDRU= X-Google-Smtp-Source: ABdhPJxZS3ynKu7b1eRQreoqdrprQgZPjcdAEZEcXY2x9KhgTr5VyNONTqCP1wB1aN2IrYfc46gmYg== X-Received: by 2002:a17:90a:8086:: with SMTP id c6mr6660314pjn.147.1605145551251; Wed, 11 Nov 2020 17:45:51 -0800 (PST) Received: from localhost ([2409:10:2e40:5100:6e29:95ff:fe2d:8f34]) by smtp.gmail.com with ESMTPSA id a10sm3776091pjq.17.2020.11.11.17.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 17:45:49 -0800 (PST) Date: Thu, 12 Nov 2020 10:45:46 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Steven Rostedt , John Ogness , Linus Torvalds , Guenter Roeck , Shreyas Joshi , shreyasjoshi15@gmail.com, Greg Kroah-Hartman , Sergey Senozhatsky , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCH 1/2] init/console: Use ttynull as a fallback when there is no console Message-ID: References: <20201111135450.11214-1-pmladek@suse.com> <20201111135450.11214-2-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (20/11/12 09:17), Sergey Senozhatsky wrote: > On (20/11/11 14:54), Petr Mladek wrote: > [..] > > diff --git a/init/main.c b/init/main.c > > index 130376ec10ba..24413c055a85 100644 > > --- a/init/main.c > > +++ b/init/main.c > > @@ -1470,8 +1470,14 @@ void __init console_on_rootfs(void) > > struct file *file = filp_open("/dev/console", O_RDWR, 0); > > > > if (IS_ERR(file)) { > > - pr_err("Warning: unable to open an initial console.\n"); > > - return; > > + pr_err("Warning: unable to open an initial console. Fallback to ttynull.\n"); > > + register_ttynull_console(); > > + > > A nit, this probably can be done in console_device() function. > > For several reasons: > > - we will get covered all the future cases when something other than > console_on_rootfs() will filp_open("/dev/console") And the existing ones (including user-space). For instance, kernel/bpf/preload/iterators/iterators.c probably fails (?) on systems with console= debug_fd = open("/dev/console", O_WRONLY | O_NOCTTY | O_CLOEXEC); if (debug_fd < 0) return 1; -ss