[PATCH] makedumpfile: copy over the 'erase_ch' member while splitting filter info.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Mahesh,

On Tue, 02 Apr 2013 10:43:59 +0530
Mahesh J Salgaonkar <mahesh at linux.vnet.ibm.com> wrote:

> From: Mahesh Salgaonkar <mahesh at linux.vnet.ibm.com>
> 
> Recent eppic support in makedumpfile has introduced 'erase_ch' member in
> filter_info structure. This member holds the erase character specified by the
> user to poison the memory location in the dump file that require to be scrubbed
> out. But, when the memory range to be scrubbed out is spanned across multiple
> pages, only the memory that belongs to first page is poisoned with the
> character set in 'erase_ch' member. The rest of the memory gets poisoned with
> 'null' character. This is because, the 'erase_ch' member is not copied over
> while splitting filter info in split_filter_info() function.
> 
> Signed-off-by: Mahesh Salgaonkar <mahesh at linux.vnet.ibm.com>
> Signed-off-by: Suzuki Poulose <suzuki at in.ibm.com>
> ---
>  erase_info.c |   11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/erase_info.c b/erase_info.c
> index 61fe637..a1b08e0 100644
> --- a/erase_info.c
> +++ b/erase_info.c
> @@ -1921,12 +1921,15 @@ split_filter_info(struct filter_info *prev, unsigned long long next_paddr,
>  		ERRMSG("Can't allocate memory to split filter info\n");
>  		return;
>  	}
> -	new->nullify        = prev->nullify;
> -	new->erase_info_idx = prev->erase_info_idx;
> -	new->size_idx       = prev->size_idx;
> +	
> +	/*
> +	 * copy over existing data from prev node and only update fields
> +	 * that differ. This approach will take care of copying over of any
> +	 * future member addition to filter_info structure.
> +	 */
> +	*new = *prev;
>  	new->paddr          = next_paddr;
>  	new->size           = size;
> -	new->next           = prev->next;
>  	prev->next          = new;
>  }

Sounds good!
I'll merge this patch into v1.5.4.


Thanks
Atsushi Kumagai



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux