Skip to contentSkip to conversation

minor bug fix in SFS filesystem

PATCH Kalamatee 2 participants 2 messages Jun 15, 2008

lore
Share & tools
lore

Kalamatee

author
#0 lore raw

Im resubmitting an individual patch by Alain Greppin which was originaly provided as part of a much larger patch (and declined for that reason).

2008-03-08 Alain Greppin <[email protected]>
* fs/sfs.c (grub_sfs_read_extent ): Fix the count of nodes in extent-btree
which is written as big endian on disk.

sfs.c (working copy) renamed from sfs.c (revision 27991) +2 -1
Index: fs/sfs.c
===================================================================
@@ -172,7 +172,8 @@
          return grub_errno;
        }
 
-      for (i = 0; i < tree->nodes; i++)
+      grub_uint16_t nodescount = grub_be_to_cpu16(tree->nodes);
+      for (i = 0; i < nodescount; i++)
        {
 

#define EXTNODE(tree, index) \
@@ -189,7 +190,7 @@

/* In case the last node is reached just use that one, it is
the right match. */
- if (i + 1 == tree->nodes && !tree->leaf)
+ if (i + 1 == nodescount && !tree->leaf)

            {
              next = grub_be_to_cpu32 (EXTNODE (tree, i)->data);
              break;
#1 lore raw
Quoted 7 lines · Kalamatee

Im resubmitting an individual patch by Alain Greppin which was originaly provided as part of a much larger patch (and declined for that reason).

2008-03-08 Alain Greppin <[email protected]>
* fs/sfs.c (grub_sfs_read_extent ): Fix the count of nodes in extent-btree
which is written as big endian on disk.

Thanks. I checked in an equivalent fix.

Signature · 5 lines
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What good is a phone call… if you are unable to speak?
(as seen on /.)