Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp105459pxb; Wed, 11 Nov 2020 21:45:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsbxdlehnGZsZrfLIf7KapV0wRtgUybHW3869UYgeQsL55XA4yWoa3mnsSy5VPkTu9dcJ6 X-Received: by 2002:a17:906:a250:: with SMTP id bi16mr27241577ejb.265.1605159958601; Wed, 11 Nov 2020 21:45:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605159958; cv=none; d=google.com; s=arc-20160816; b=aQ4HDrzRr71hyERgBok6uUcZNzx2f2uCBUVDFTjMf/SHeR2SPLZJuauFfKB578vSZC ebsYfJS2DkKICW0zpGjAay5j9QoIjcmYW4rF0Z5vNw9H6FSFch62FMqFxp5fiZjVP8O3 jRqRp68kZV7z8nkvKcppR/1Is5bkwrpA2xcYeD5aweZlS9cEbpJDWcTamvnFVwFTOZix OoHBrr4kSHIcxYmjXZ4mUQp7rQLnFeK4rXZyYywxb9QOZxqRctexdBWn3mEOVtEHsQas BENjhCyQRpXggUCjYmcRhnuVpvaXqOSTCOQfbPq6+GPA6zkEIrx2MHKkqjblRg9TqDcl ptNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GQhUQl5SKV0omnprfPWc5RGNu6gDlIOdHOTSpdoTP04=; b=VKnkJuJ+072EYsmqMOEv6Y++1uzra+bbtfzdL33suQxFB4JzqnY2ZncwHxurWPdjVP HS1FEWb/GRs2hYNMCR0z4a/ihfm9WoZAtShPj6utIhKwEx8sLuBJTG8eciX/chdKv/b8 pHt9hDOFao7oUkx3mh+sZuA6OeOLUYfIpC7Ymkzaln28pnO0GUPzsSVYIk5tIssfSf0S iuVoQshg1bIBx4CEGV+Aq1BI03xllsBKx6QCUcXTqNEJx4cAGMSAKx/5CeCI23eiB46G sdbLYaCSW7jx4UzJBEf5CnGwzd7pt1z8N0pdLzSR6LDWkTuGZLjNTeTNX/LpTaocR8MS zz9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tdb4UZpb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di27si3113278edb.486.2020.11.11.21.45.35; Wed, 11 Nov 2020 21:45:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tdb4UZpb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728141AbgKLFdP (ORCPT + 99 others); Thu, 12 Nov 2020 00:33:15 -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-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