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

Mahesh J Salgaonkar mahesh at linux.vnet.ibm.com
Tue Apr 2 01:13:59 EDT 2013


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;
 }
 




More information about the kexec mailing list