[Crash-utility] LKCD v9 dumps with non-standard dump header size
Dave Anderson
anderson at redhat.com
Thu Dec 15 14:09:25 UTC 2005
Troy Heber wrote:
> On 11/29/05 08:46, Dave Anderson wrote:
> >
> > Looks good to me, unless any other LKCD-ophiles have any objection.
>
> We need the following patch to allow crash to still read v8 dumps.
>
> Troy
I don't think that the "else" part is required since lkcd_offset_to_first_page
is statically initialized to LKCD_OFFSET_TO_FIRST_PAGE above. But
for readability this looks fine to me.
Thanks,
Dave
>
>
> --- lkcd_v8.c.ori 2005-12-08 14:53:07.026719000 -0700
> +++ lkcd_v8.c 2005-12-14 14:52:40.086407560 -0700
> @@ -57,10 +57,13 @@
> if (read(lkcd->fd, dh, sizeof(dump_header_t)) !=
> sizeof(dump_header_t))
> return FALSE;
> - if ((dh->dh_version & LKCD_DUMP_VERSION_NUMBER_MASK) == LKCD_DUMP_V9)
> + if ((dh->dh_version & LKCD_DUMP_VERSION_NUMBER_MASK) == LKCD_DUMP_V9){
> if (read(lkcd->fd, &dh_dump_buffer_size, sizeof(dh_dump_buffer_size)) !=
> sizeof(dh_dump_buffer_size))
> return FALSE;
> + lkcd_offset_to_first_page = dh_dump_buffer_size;
> + } else
> + lkcd_offset_to_first_page = LKCD_OFFSET_TO_FIRST_PAGE;
>
> lkcd->dump_page = dp;
> lkcd->dump_header = dh;
> @@ -147,7 +150,6 @@
> lkcd->compression = dh->dh_dump_compress;
> lkcd->page_header_size = sizeof(dump_page_t);
>
> - lkcd_offset_to_first_page = dh_dump_buffer_size;
> lseek(lkcd->fd, lkcd_offset_to_first_page, SEEK_SET);
>
> /*
>
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
More information about the Crash-utility
mailing list