[Crash-utility] LKCD v9 dumps with non-standard dump header size

Dave Anderson anderson at redhat.com
Thu Dec 15 15:52:51 UTC 2005


Troy Heber wrote:

> On 12/15/05 09:09, Dave Anderson wrote:
> >
> > 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.
> >
>
> It's not the initialization that's the problem, it's the unconditional
> assignment of dh_dump_buffer_size in hunk 2 of the patch. That
> assignment has to be conditional on the dump version.
>

Right -- I understand.  All I was saying is this "else" clause:

+       } else
+           lkcd_offset_to_first_page = LKCD_OFFSET_TO_FIRST_PAGE;

should be unnecessary since it defaults to that value anyway?

Whatever... I'm applying your patch as you've posted it.

Thanks,
  Dave


>
> Troy
>
> > > --- 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