From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1L69jr-0007Cf-RF for mharc-grub-devel@gnu.org; Fri, 28 Nov 2008 15:14:55 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L69jp-0007A0-CO for grub-devel@gnu.org; Fri, 28 Nov 2008 15:14:53 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L69jn-00078Q-Vl for grub-devel@gnu.org; Fri, 28 Nov 2008 15:14:52 -0500 Received: from [199.232.76.173] (port=40971 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L69jn-00078G-JD for grub-devel@gnu.org; Fri, 28 Nov 2008 15:14:51 -0500 Received: from aybabtu.com ([69.60.117.155]:42290) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L69jn-0004Ly-47 for grub-devel@gnu.org; Fri, 28 Nov 2008 15:14:51 -0500 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 1L69gn-00083e-BJ; Fri, 28 Nov 2008 21:11:45 +0100 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1L69j6-0003F8-Vp; Fri, 28 Nov 2008 21:14:08 +0100 Date: Fri, 28 Nov 2008 21:14:08 +0100 From: Robert Millan To: The development of GRUB 2 Message-ID: <20081128201408.GG7980@thorin> References: <492863A7.7090902@wp.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <492863A7.7090902@wp.pl> 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-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Subject: Re: [PATCH] Corrections to affs and sfs 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, 28 Nov 2008 20:14:53 -0000 On Sat, Nov 22, 2008 at 08:55:19PM +0100, Krzysztof Smiechowicz wrote: > Hello, > > I would like to submit the following patch: > > * fs/affs.c: Return failure when directory iteration failed. > > * fs/sfs.c: Return failure when directory iteration failed. Correct > order in which btree nodes are read. > > These changes are needed to boot AROS Research Operating System from SFS > / FFS. Hi, > Index: fs/affs.c > =================================================================== > --- fs/affs.c (revision 1919) > +++ fs/affs.c (working copy) > @@ -381,7 +381,7 @@ > fail: > grub_free (node); > grub_free (hashtable); > - return 1; > + return 0; > } I checked in this hunk (and the equivalent sfs.c one) > Index: fs/sfs.c > =================================================================== > --- fs/sfs.c (revision 1919) > +++ fs/sfs.c (working copy) > @@ -172,7 +172,8 @@ > return grub_errno; > } > > - for (i = 0; i < grub_be_to_cpu16 (tree->nodes); i++) > + grub_uint16_t nodescount = grub_be_to_cpu16(tree->nodes); > + for (i = nodescount - 1; i >= 0; i--) nodescount is only used once; why adding a variable? > /* Follow the tree down to the leaf level. */ > - if ((grub_be_to_cpu32 (EXTNODE(tree, i)->key) >= block) > + if ((grub_be_to_cpu32 (EXTNODE(tree, i)->key) <= block) > && !tree->leaf) > { > - next = grub_be_to_cpu32 (EXTNODE (tree, i - 1)->data); > - break; > - } > - > - /* In case the last node is reached just use that one, it is > - the right match. */ > - if (i + 1 == grub_be_to_cpu16 (tree->nodes) && !tree->leaf) > - { > next = grub_be_to_cpu32 (EXTNODE (tree, i)->data); > break; > } I'm not familiar with our SFS code. Marco, if you have a minute could you review this part? -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."