Blame SOURCES/kexec-tools-2.0.15-i386-kdump-fix-an-error-that-can-not-parse-the-e820-reser.patch

bedde7
From 1ac3e4a570005707260ea3e74ac011bd926b168b Mon Sep 17 00:00:00 2001
bedde7
From: Lianbo Jiang <lijiang@redhat.com>
bedde7
Date: Thu, 6 Sep 2018 13:56:18 +0800
bedde7
Subject: [PATCH] kdump: fix an error that can not parse the e820 reserved
bedde7
 region
bedde7
bedde7
When kexec-tools load the kernel and initramfs for kdump, kexec-tools will
bedde7
read /proc/iomem and recreate the e820 ranges for kdump kernel. But it fails
bedde7
to parse the e820 reserved region, because the memcmp() is case sensitive
bedde7
when comparing the string. In fact, it may be "Reserved" or "reserved" in
bedde7
the /proc/iomem, so we have to fix these cases.
bedde7
bedde7
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
bedde7
Reviewed-by: Dave Young <dyoung@redhat.com>
bedde7
Signed-off-by: Simon Horman <horms@verge.net.au>
bedde7
---
bedde7
 kexec/arch/i386/crashdump-x86.c | 2 ++
bedde7
 1 file changed, 2 insertions(+)
bedde7
bedde7
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
bedde7
index 437e8a8..140f45b 100644
bedde7
--- a/kexec/arch/i386/crashdump-x86.c
bedde7
+++ b/kexec/arch/i386/crashdump-x86.c
bedde7
@@ -289,6 +289,8 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges,
bedde7
			type = RANGE_PMEM;
bedde7
		} else if(memcmp(str,"reserved\n",9) == 0 ) {
bedde7
			type = RANGE_RESERVED;
bedde7
+		} else if (memcmp(str, "Reserved\n", 9) == 0) {
bedde7
+			type = RANGE_RESERVED;
bedde7
		} else if (memcmp(str, "GART\n", 5) == 0) {
bedde7
			gart_start = start;
bedde7
			gart_end = end;
bedde7
--
bedde7
2.17.1