Fix extent overflow comparator.

* grub-core/fs/hfsplus.c (grub_hfsplus_extkey_internal): Add type.
	(grub_hfsplus_read_block): Set type.
	(grub_hfsplus_cmp_extkey): Compare type.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-05-26 11:54:20 +02:00
parent d6b1fd3654
commit 77ceedb634
2 changed files with 15 additions and 0 deletions

View file

@ -1,3 +1,11 @@
2012-05-25 Vladimir Serbinenko <phcoder@gmail.com>
Fix extent overflow comparator.
* grub-core/fs/hfsplus.c (grub_hfsplus_extkey_internal): Add type.
(grub_hfsplus_read_block): Set type.
(grub_hfsplus_cmp_extkey): Compare type.
2012-05-25 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-fstest.c (cmd_cmp): Fix stat'ing of wrong file.

View file

@ -189,6 +189,7 @@ struct grub_hfsplus_catkey_internal
struct grub_hfsplus_extkey_internal
{
grub_uint32_t fileid;
grub_uint8_t type;
grub_uint32_t start;
};
@ -341,6 +342,7 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
/* Set up the key to look for in the extent overflow file. */
extoverflow.extkey.fileid = node->fileid;
extoverflow.extkey.type = 0;
extoverflow.extkey.start = fileblock - blksleft;
if (grub_hfsplus_btree_search (&node->data->extoverflow_tree,
@ -579,6 +581,11 @@ grub_hfsplus_cmp_extkey (struct grub_hfsplus_key *keya,
return 1;
if (akey < extkey_b->fileid)
return -1;
if (extkey_a->type > extkey_b->type)
return 1;
if (extkey_a->type < extkey_b->type)
return -1;
akey = grub_be_to_cpu32 (extkey_a->start);
if (akey > extkey_b->start)