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

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