|
@@ -205,7 +205,7 @@ static void grow_zone_span(struct zone *zone, unsigned long start_pfn,
|
|
|
zone_span_writelock(zone);
|
|
|
|
|
|
old_zone_end_pfn = zone->zone_start_pfn + zone->spanned_pages;
|
|
|
- if (start_pfn < zone->zone_start_pfn)
|
|
|
+ if (!zone->spanned_pages || start_pfn < zone->zone_start_pfn)
|
|
|
zone->zone_start_pfn = start_pfn;
|
|
|
|
|
|
zone->spanned_pages = max(old_zone_end_pfn, end_pfn) -
|
|
@@ -220,7 +220,7 @@ static void grow_pgdat_span(struct pglist_data *pgdat, unsigned long start_pfn,
|
|
|
unsigned long old_pgdat_end_pfn =
|
|
|
pgdat->node_start_pfn + pgdat->node_spanned_pages;
|
|
|
|
|
|
- if (start_pfn < pgdat->node_start_pfn)
|
|
|
+ if (!pgdat->node_spanned_pages || start_pfn < pgdat->node_start_pfn)
|
|
|
pgdat->node_start_pfn = start_pfn;
|
|
|
|
|
|
pgdat->node_spanned_pages = max(old_pgdat_end_pfn, end_pfn) -
|