[PATCH v2 7/8] makedumpfile: Add erased information in compressed kdump file
Mahesh Jagannath Salgaonkar
mahesh at linux.vnet.ibm.com
Thu Aug 18 04:14:12 EDT 2011
Hi Ken'ichi,
On 08/12/2011 01:40 PM, Ken'ichi Ohmichi wrote:
>
> Hi Mahesh,
>
> On Wed, 18 May 2011 01:36:17 +0530
> Mahesh J 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.
Do you think I should change this patch to use '-1' as invalid index?
>
>
>> @@ -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.
Thanks,
-Mahesh.
More information about the kexec
mailing list