Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S269127AbUJFIon (ORCPT ); Wed, 6 Oct 2004 04:44:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S269121AbUJFIom (ORCPT ); Wed, 6 Oct 2004 04:44:42 -0400 Received: from witte.sonytel.be ([80.88.33.193]:10626 "EHLO witte.sonytel.be") by vger.kernel.org with ESMTP id S269127AbUJFIoc (ORCPT ); Wed, 6 Oct 2004 04:44:32 -0400 Date: Wed, 6 Oct 2004 10:43:52 +0200 (MEST) From: Geert Uytterhoeven To: Willy Tarreau , =?ISO-8859-15?Q?J=F6rn_Engel?= cc: Denis Vlasenko , Linux Kernel Development Subject: Re: [PATCH] Console: fall back to /dev/null when no console is availlable In-Reply-To: <20041006043458.GB19761@alpha.home.local> Message-ID: References: <20041005185214.GA3691@wohnheim.fh-wedel.de> <200410060058.57244.vda@port.imtp.ilyichevsk.odessa.ua> <20041006043458.GB19761@alpha.home.local> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1543 Lines: 37 On Wed, 6 Oct 2004, Willy Tarreau wrote: > On Wed, Oct 06, 2004 at 12:58:57AM +0300, Denis Vlasenko wrote: > > > + if (open("/dev/null", O_RDWR, 0) == 0) > > > + printk(" Falling back to /dev/null.\n"); > > > + } > > > > What will happen if /dev is totally empty? > > ... Which is the most probable reason causing this trouble. Indeed, but there are other known cases. Some debug methods use register_console() to get their print routines registered. If people forget to say e.g. `console=tty0' afterwards, the debug console without the real device cannot be opened through /dev/console, and they get a mysterious error. Usually /dev/console _is_ present in the root fs. Perhaps a better fix is to modify the /dev/console demux code to fall back to `/dev/null' (quotes to indicate this has nothing to do with a present /dev/null on your root fs or ramdisk, but that it's the virtual null device) if the struct console corresponding to /dev/console is not an existing tty device. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/