[PATCH] makedumpfile: Fix a bug found during regression testing for v1.5.6

Atsushi Kumagai kumagai-atsushi at mxc.nes.nec.co.jp
Wed Apr 16 01:11:27 PDT 2014


Hello,

I have to do regression testing again for this issue and the OOM
issue reported by Vivek, so the release of v1.5.6 will be put off
to next week.

Thanks for your patience.

Atsushi Kumagai

--
From: Atsushi Kumagai <kumagai-atsushi at mxc.nes.nec.co.jp>
Date: Wed, 16 Apr 2014 14:56:01 +0900
Subject: [PATCH] Exclude small cycle regions wrongly.

In bitmap initialization, if a cycle region is smaller than 8 pages
and its start_pfn is aligned to multiple of 8 pages, it will be
excluded wrongly.

  Example case:
    pfn_start=0x103ff80, pfn_start_roundup=0x103ff80
    pfn_end=0x103ff84, pfn_end_round=0x103ff80

This case doesn't meet any conditions to set bits in
create_1st_bitmap_cyclic() and initialize_2nd_bitmap_cyclic().
We should admit the case where pfn_start is equal to pfn_end_round
like above.

Signed-off-by: Atsushi Kumagai <kumagai-atsushi at mxc.nes.nec.co.jp>
---
 makedumpfile.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index da960ad..dd9373d 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -4545,7 +4545,7 @@ create_1st_bitmap_cyclic(struct cycle *cycle)
 			pfn_bitmap1 += (pfn_end_byte - pfn_start_byte) * BITPERBYTE;
 		}
 
-		if (pfn_end_round > pfn_start) {
+		if (pfn_end_round >= pfn_start) {
 			for (pfn = pfn_end_round; pfn < pfn_end; pfn++) {
 				if (set_bit_on_1st_bitmap(pfn, cycle))
 					pfn_bitmap1++;
@@ -4653,7 +4653,7 @@ initialize_2nd_bitmap_cyclic(struct cycle *cycle)
 			       pfn_end_byte - pfn_start_byte);
 		}
 
-		if (pfn_end_round > pfn_start) {
+		if (pfn_end_round >= pfn_start) {
 			for (pfn = pfn_end_round; pfn < pfn_end; ++pfn) {
 				if (!set_bit_on_2nd_bitmap_for_kernel(pfn, cycle))
 					return FALSE;
-- 
1.8.0.2



More information about the kexec mailing list