Received: from list by lists.gnu.org with archive (Exim 4.71) id 1QjfFe-00019e-8q for mharc-grub-devel@gnu.org; Wed, 20 Jul 2011 18:28:22 -0400 Received: from eggs.gnu.org ([140.186.70.92]:52786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjfFb-00019L-5R for grub-devel@gnu.org; Wed, 20 Jul 2011 18:28:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjfFY-0003og-3i for grub-devel@gnu.org; Wed, 20 Jul 2011 18:28:18 -0400 Received: from solo.fdn.fr ([80.67.169.19]:38513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjfFX-0003oG-O0 for grub-devel@gnu.org; Wed, 20 Jul 2011 18:28:15 -0400 Received: from const.ipv6 (youpi.is-a-geek.org [80.67.176.89]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by solo.fdn.fr (Postfix) with ESMTPS id E38F4445C0; Thu, 21 Jul 2011 00:28:09 +0200 (CEST) Received: from samy by const.ipv6 with local (Exim 4.76) (envelope-from ) id 1QjfFQ-0007Tf-Vi; Thu, 21 Jul 2011 00:28:08 +0200 Date: Thu, 21 Jul 2011 00:28:08 +0200 From: Samuel Thibault To: The development of GNU GRUB Subject: Re: grub2 claims grub.cfg is out of partition Message-ID: <20110720222808.GE7303@const.famille.thibault.fr> References: <1311198605.2740.58.camel@x60> <4E27506F.6040702@gmail.com> <1311200227.2740.60.camel@x60> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="n8g4imXOkfNTN/H1" Content-Disposition: inline In-Reply-To: <1311200227.2740.60.camel@x60> User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 80.67.169.19 Cc: Vladimir =?utf-8?Q?'=CF=86-coder=2Fphcoder'?= Serbinenko , 634799@bugs.debian.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 22:28:20 -0000 --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline tags 634799 + upstream patch thanks Hello, Digging a bit with the issue, it seems grub2 does not ignore entries with inode == 0 while it should. See linux' ext2_readdir() in fs/ext2/dir.c doing it: for ( ;(char*)de <= limit; de = ext2_next_entry(de)) { if (de->inode) { ... } } The attached patch fixes it. Shall I commit it to upstream grub2? Samuel --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch === modified file 'grub-core/fs/ext2.c' --- grub-core/fs/ext2.c 2011-04-11 21:01:51 +0000 +++ grub-core/fs/ext2.c 2011-07-20 22:20:43 +0000 @@ -689,7 +689,7 @@ grub_ext2_iterate_dir (grub_fshelp_node_ if (dirent.direntlen == 0) return 0; - if (dirent.namelen != 0) + if (dirent.inode != 0 && dirent.namelen != 0) { char filename[dirent.namelen + 1]; struct grub_fshelp_node *fdiro; --n8g4imXOkfNTN/H1--