2009-08-23 Vladimir Serbinenko <phcoder@gmail.com>
* fs/hfsplus.c (grub_hfsplus_mount): Don't ignore grub_hfsplus_read_file errors. (grub_hfsplus_btree_iterate_node): Don't ignore grub_hfsplus_read_file errors. Call grub_error when needed.
This commit is contained in:
parent
e9a925da69
commit
de74f136b7
2 changed files with 23 additions and 16 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2009-08-23 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* fs/hfsplus.c (grub_hfsplus_mount): Don't ignore grub_hfsplus_read_file
|
||||||
|
errors.
|
||||||
|
(grub_hfsplus_btree_iterate_node): Don't ignore grub_hfsplus_read_file
|
||||||
|
errors. Call grub_error when needed.
|
||||||
|
|
||||||
2009-08-23 Vladimir Serbinenko <phcoder@gmail.com>
|
2009-08-23 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* commands/search.c (search_fs): Try searching without autoload first.
|
* commands/search.c (search_fs): Try searching without autoload first.
|
||||||
|
|
32
fs/hfsplus.c
32
fs/hfsplus.c
|
@ -469,9 +469,9 @@ grub_hfsplus_mount (grub_disk_t disk)
|
||||||
grub_be_to_cpu64 (data->volheader.extents_file.size);
|
grub_be_to_cpu64 (data->volheader.extents_file.size);
|
||||||
|
|
||||||
/* Read the essential information about the trees. */
|
/* Read the essential information about the trees. */
|
||||||
if (! grub_hfsplus_read_file (&data->catalog_tree.file, 0,
|
if (grub_hfsplus_read_file (&data->catalog_tree.file, 0,
|
||||||
sizeof (struct grub_hfsplus_btnode),
|
sizeof (struct grub_hfsplus_btnode),
|
||||||
sizeof (header), (char *) &header))
|
sizeof (header), (char *) &header) <= 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
data->catalog_tree.root = grub_be_to_cpu32 (header.root);
|
data->catalog_tree.root = grub_be_to_cpu32 (header.root);
|
||||||
|
@ -479,15 +479,15 @@ grub_hfsplus_mount (grub_disk_t disk)
|
||||||
data->case_sensitive = ((magic == GRUB_HFSPLUSX_MAGIC) &&
|
data->case_sensitive = ((magic == GRUB_HFSPLUSX_MAGIC) &&
|
||||||
(header.key_compare == GRUB_HFSPLUSX_BINARYCOMPARE));
|
(header.key_compare == GRUB_HFSPLUSX_BINARYCOMPARE));
|
||||||
|
|
||||||
if (! grub_hfsplus_read_file (&data->extoverflow_tree.file, 0,
|
if (grub_hfsplus_read_file (&data->extoverflow_tree.file, 0,
|
||||||
sizeof (struct grub_hfsplus_btnode),
|
sizeof (struct grub_hfsplus_btnode),
|
||||||
sizeof (header), (char *) &header))
|
sizeof (header), (char *) &header) <= 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
data->extoverflow_tree.root = grub_be_to_cpu32 (header.root);
|
data->extoverflow_tree.root = grub_be_to_cpu32 (header.root);
|
||||||
|
|
||||||
if (! grub_hfsplus_read_file (&data->extoverflow_tree.file, 0, 0,
|
if (grub_hfsplus_read_file (&data->extoverflow_tree.file, 0, 0,
|
||||||
sizeof (node), (char *) &node))
|
sizeof (node), (char *) &node) <= 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
data->extoverflow_tree.root = grub_be_to_cpu32 (header.root);
|
data->extoverflow_tree.root = grub_be_to_cpu32 (header.root);
|
||||||
|
@ -608,10 +608,10 @@ grub_hfsplus_btree_iterate_node (struct grub_hfsplus_btree *btree,
|
||||||
if (! first_node->next)
|
if (! first_node->next)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (! grub_hfsplus_read_file (&btree->file, 0,
|
if (grub_hfsplus_read_file (&btree->file, 0,
|
||||||
(grub_be_to_cpu32 (first_node->next)
|
(grub_be_to_cpu32 (first_node->next)
|
||||||
* btree->nodesize),
|
* btree->nodesize),
|
||||||
btree->nodesize, cnode))
|
btree->nodesize, cnode) <= 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* Don't skip any record in the next iteration. */
|
/* Don't skip any record in the next iteration. */
|
||||||
|
@ -647,12 +647,12 @@ grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree,
|
||||||
int match = 0;
|
int match = 0;
|
||||||
|
|
||||||
/* Read a node. */
|
/* Read a node. */
|
||||||
if (! grub_hfsplus_read_file (&btree->file, 0,
|
if (grub_hfsplus_read_file (&btree->file, 0,
|
||||||
(long)currnode * (long)btree->nodesize,
|
(long)currnode * (long)btree->nodesize,
|
||||||
btree->nodesize, (char *) node))
|
btree->nodesize, (char *) node) <= 0)
|
||||||
{
|
{
|
||||||
grub_free (node);
|
grub_free (node);
|
||||||
return grub_errno;
|
return grub_error (GRUB_ERR_BAD_FS, "Couldn't read i-node.");
|
||||||
}
|
}
|
||||||
|
|
||||||
nodedesc = (struct grub_hfsplus_btnode *) node;
|
nodedesc = (struct grub_hfsplus_btnode *) node;
|
||||||
|
|
Loading…
Reference in a new issue