[PATCH v2 7/8] makedumpfile: Add erased information in compressed kdump file
Ken'ichi Ohmichi
oomichi at mxs.nes.nec.co.jp
Fri Aug 19 01:39:30 EDT 2011
Hi Mahesh,
On Thu, 18 Aug 2011 13:44:12 +0530
Mahesh Jagannath Salgaonkar <mahesh at linux.vnet.ibm.com> wrote:
> >> --- a/makedumpfile.c
> >> +++ b/makedumpfile.c
> >> @@ -29,6 +29,8 @@ struct DumpInfo *info = NULL;
> >> struct module_sym_table mod_st = { 0 };
> >> struct filter_info *filter_info = NULL;
> >> struct filter_config filter_config;
> >> +struct erase_info *erase_info = NULL;
> >> +unsigned long num_erase_info = 1; /* Node 0 is unused. */
> >
> > I cannot understand erase_info[0] is unused.
>
> I did this to avoid the explicit need of initializing erase_info_idx
> member from struct config_entry and struct filter_info with some other
> invalid value, instead I thought I will use '0' as invalid index.
Thank you for the explanation. I can understand your thought.
I think current code is right and we don't need to change the code.
Sorry about my noise.
> >> @@ -6000,10 +6007,17 @@ write_kdump_header(void)
> >> kh.size_vmcoreinfo = info->size_vmcoreinfo;
> >> }
> >> }
> >> - if (!write_buffer(info->fd_dumpfile, dh->block_size, &kh,
> >> - size, info->name_dumpfile))
> >> - goto out;
> >> + /*
> >> + * While writing dump data to STDOUT, delay the writing of sub header
> >> + * untill we gather erase info offset and size.
> >> + */
> >> + if (!info->flag_flatten) {
> >> + if (!write_buffer(info->fd_dumpfile, dh->block_size, &kh,
> >> + size, info->name_dumpfile))
> >> + goto out;
> >> + }
> >
> > Does makedumpfile work wrong if removing the above change ?
> >
>
> Hmm.. while implementing this patch I thought we may run into issues if
> we write sub_header data twice for flattened case. But it seems the '-R'
> option rearranges the data properly.
>
> I agree that we dont need above change. Thanks for catching this.
OK, I will revert the above change.
Thanks
Ken'ichi Ohmichi
More information about the kexec
mailing list