+2008-06-13 Bean <bean123ch@gmail.com>
+
+ * commands/hexdump.c (grub_cmd_hexdump): Adjust offset for partition.
+
+ * fs/ext2.c (grub_ext3_get_journal): Fix revoke block handling.
+
+ * fs/fshelp.c (grub_fshelp_map_block): Don't map block 0 as it's used
+ to indicate sparse block.
+
2008-06-12 Pavel Roskin <proski@gnu.org>
* fs/ext2.c (grub_ext2_read_inode): Don't normalize block
#include <grub/misc.h>
#include <grub/gzio.h>
#include <grub/hexdump.h>
+#include <grub/partition.h>
static const struct grub_arg_option options[] = {
{"skip", 's', 0, "skip offset bytes from the beginning of file.", 0,
{
char buf[GRUB_DISK_SECTOR_SIZE * 4];
grub_ssize_t size, length;
- unsigned long skip;
+ grub_disk_addr_t skip;
int namelen;
if (argc != 1)
if (! disk)
return 0;
+ if (disk->partition)
+ skip += grub_partition_get_start (disk->partition) << GRUB_DISK_SECTOR_BITS;
+
sector = (skip >> (GRUB_DISK_SECTOR_BITS + 2)) * 4;
ofs = skip & (GRUB_DISK_SECTOR_SIZE * 4 - 1);
while (length)
{
struct grub_ext3_journal_header *jh;
- if (grub_fshelp_read_file (data->disk, &data->logfile, 0,
- block << (log2bs + 9), sizeof (buf),
- buf, grub_ext2_read_block,
- log->last_block << (log2bs + 9),
- log2bs) !=
- (int) sizeof (buf))
+ grub_fshelp_read_file (data->disk, &data->logfile, 0,
+ block << (log2bs + 9), sizeof (buf),
+ buf, grub_ext2_read_block,
+ log->last_block << (log2bs + 9),
+ log2bs);
+ if (grub_errno)
break;
jh = (struct grub_ext3_journal_header *) &buf[0];
case EXT3_JOURNAL_REVOKE_BLOCK:
{
struct grub_ext3_journal_revoke_header *jrh;
- grub_uint32_t i;
+ grub_uint32_t i, cnt;
jrh = (struct grub_ext3_journal_revoke_header *) jh;
+ cnt = (grub_be_to_cpu32 (jrh->count) -
+ sizeof (struct grub_ext3_journal_revoke_header)) >> 2;
- for (i = 0; i < grub_be_to_cpu32 (jrh->count); i++)
+ for (i = 0; i < cnt; i++)
{
int j;
grub_uint32_t map;