+2009-06-11 Giuseppe Caizzone <acaizzo@gmail.com>
+
+ UDF fix
+
+ * fs/udf.c (grub_udf_read_block): handle the fact that ad->length
+ is in bytes and not in blocks
+
2009-06-11 Pavel Roskin <proski@gnu.org>
* kern/i386/halt.c (grub_halt): Make `i' unsigned to fix a
{
char *ptr;
int len;
+ grub_disk_addr_t filebytes;
if (U16 (node->fe.tag.tag_ident) == GRUB_UDF_TAG_IDENT_FE)
{
struct grub_udf_short_ad *ad = (struct grub_udf_short_ad *) ptr;
len /= sizeof (struct grub_udf_short_ad);
+ filebytes = fileblock * GRUB_UDF_BLKSZ;
while (len > 0)
{
- if (fileblock < U32 (ad->length))
+ if (filebytes < U32 (ad->length))
return ((U32 (ad->position) & GRUB_UDF_EXT_MASK) ? 0 :
(grub_udf_get_block (node->data,
node->part_ref,
ad->position)
- + fileblock));
+ + (filebytes / GRUB_UDF_BLKSZ)));
- fileblock -= U32 (ad->length);
+ filebytes -= U32 (ad->length);
ad++;
len--;
}
struct grub_udf_long_ad *ad = (struct grub_udf_long_ad *) ptr;
len /= sizeof (struct grub_udf_long_ad);
+ filebytes = fileblock * GRUB_UDF_BLKSZ;
while (len > 0)
{
- if (fileblock < U32 (ad->length))
+ if (filebytes < U32 (ad->length))
return ((U32 (ad->block.block_num) & GRUB_UDF_EXT_MASK) ? 0 :
(grub_udf_get_block (node->data,
ad->block.part_ref,
ad->block.block_num)
- + fileblock));
+ + (filebytes / GRUB_UDF_BLKSZ)));
- fileblock -= U32 (ad->length);
+ filebytes -= U32 (ad->length);
ad++;
len--;
}