Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Ekqkb-0003xy-BS for mharc-grub-devel@gnu.org; Fri, 09 Dec 2005 17:30:01 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EkqkY-0003wu-Pv for grub-devel@gnu.org; Fri, 09 Dec 2005 17:29:58 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EkqkX-0003wM-FL for grub-devel@gnu.org; Fri, 09 Dec 2005 17:29:58 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EkqkX-0003wH-7D for grub-devel@gnu.org; Fri, 09 Dec 2005 17:29:57 -0500 Received: from [194.109.24.28] (helo=smtp-vbr8.xs4all.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Ekqln-00020A-8u for grub-devel@gnu.org; Fri, 09 Dec 2005 17:31:15 -0500 Received: from localhost.localdomain (mgerards.xs4all.nl [82.92.27.129]) by smtp-vbr8.xs4all.nl (8.13.3/8.13.3) with ESMTP id jB9MTUWD080042 for ; Fri, 9 Dec 2005 23:29:31 +0100 (CET) (envelope-from mgerards@xs4all.nl) Mail-Copies-To: mgerards@xs4all.nl To: The development of GRUB 2 References: <4399FE01.7010402@nic.fi> From: Marco Gerards Date: Fri, 09 Dec 2005 23:29:32 +0100 In-Reply-To: <4399FE01.7010402@nic.fi> (Vesa =?iso-8859-1?Q?J=E4=E4skel=E4?= =?iso-8859-1?Q?inen's?= message of "Fri, 09 Dec 2005 23:58:25 +0200") Message-ID: <87mzj9q4z7.fsf@xs4all.nl> User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by XS4ALL Virus Scanner Subject: Re: problem in usage of grub_errno... X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2005 22:29:59 -0000 Vesa J=E4=E4skel=E4inen writes: > Some folks might have overlooked my earlier post as I wrote it to video > subsystem thread. As this problem needs some kind of resolution and it > affects larger area of code than just video subsystem it needs to be > discussed first. > > Problem is this: > 1. error occures and grub_errno is being set to something else than > GRUB_ERR_NONE (0). > 2. now some operation needs to read from disk, but it will fail as > gurb_errno was set. > > Real world example: > Let's assume that there is a file not found exception. There is graphics > mode activated and not all fonts are cached in memory (as is currently > the case). Now as file not found exception sets grub_errno to > GRUB_ERR_FILE_NOT_FOUND and most likely sets some string to grub_errmsg. > All is good so far. But when the actual rendering happens, and font > manager tries to read font data from disk it fails, because grub_errno > is set. In many place there is code like this "if (grub_errno) return > grub_errno;" in file system code and in disk drivers. Now if grub_errno > is set else where this code will fail, even if there wasn't really i/o > error. You should in general test all functions if they return an error. If you think an error should be ignored, set grub_errno to 0. So if the file was not found you should either clear the error and ignore it, or return the error so the error can be reported to the user. But I don't like it that the console can get critical errors. When can and does this happen? What are the worst case scenarious? -- Marco