From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KKDPv-0004jG-TO for mharc-grub-devel@gnu.org; Sat, 19 Jul 2008 10:28:11 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KKDPt-0004eg-2o for grub-devel@gnu.org; Sat, 19 Jul 2008 10:28:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KKDPp-0004Xc-22 for grub-devel@gnu.org; Sat, 19 Jul 2008 10:28:06 -0400 Received: from [199.232.76.173] (port=56205 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KKDPo-0004Wo-G5 for grub-devel@gnu.org; Sat, 19 Jul 2008 10:28:04 -0400 Received: from aybabtu.com ([69.60.117.155]:37242) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KKDPo-0008LL-Q9 for grub-devel@gnu.org; Sat, 19 Jul 2008 10:28:05 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1KKDKF-0003zM-Ch for grub-devel@gnu.org; Sat, 19 Jul 2008 16:22:20 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1KKDOt-0006Fa-4S for grub-devel@gnu.org; Sat, 19 Jul 2008 16:27:07 +0200 Date: Sat, 19 Jul 2008 16:27:07 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20080719142707.GA23778@thorin> References: <20080703140211.GA19341@thorin> <1215104875.8123.23.camel@localhost> <20080704000829.GE4074@thorin> <1215135163.26019.44.camel@localhost> <20080704142125.GC2663@thorin> <1215182702.26019.130.camel@localhost> <20080704185723.GB32625@thorin> <1215204095.26019.142.camel@localhost> <20080705120757.GA1647@thorin> <1215282973.26019.183.camel@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1215282973.26019.183.camel@localhost> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: grub-probe detects ext4 wronly as ext2 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: Sat, 19 Jul 2008 14:28:09 -0000 On Sat, Jul 05, 2008 at 08:36:13PM +0200, Javier Martín wrote: > > > grub_disk_read (disk, 1 * 2, 0, sizeof (struct grub_ext2_sblock), > > > (char *) &data->sblock); > > > if (grub_errno) > > > - goto fail; > > > + EXT2_DRIVER_MOUNT_FAIL("could not read the superblock") > > > > This overrides the grub_errno and grub_errmsg provided by grub_disk_read and > > replaces them with values that hide the true problem. If there was a disk > > read error, we really want to know about it from the lower layer. > Well, the old version did just the same (even worse, because the message > was generic). What would be the correct path of action here? I mean, how > can we propagate the error messages? It shouldn't call grub_error(). > fail: > - grub_error (GRUB_ERR_BAD_FS, "not an ext2 filesystem"); > + if (!err_msg) > + err_msg = "DEBUG: mount failed but no error message supplied!"; No need to check for consistency in your own code. This might be a good practice in userland programs but here it's a waste of space. Just make sure your code is correct. -- Robert Millan I know my rights; I want my phone call! What good is a phone call… if you are unable to speak? (as seen on /.)