Re: [PATCH 1/2] mm: page_isolation: check pfn validity before access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(2014/11/06 17:08), Weijie Yang wrote:
In the undo path of start_isolate_page_range(), we need to check
the pfn validity before access its page, or it will trigger an
addressing exception if there is hole in the zone.

Signed-off-by: Weijie Yang <weijie.yang@xxxxxxxxxxx>
---

Looks good to me.

Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@xxxxxxxxxxxxxx>

Thanks,
Yasuaki Ishimatsu

  mm/page_isolation.c |    7 +++++--
  1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/mm/page_isolation.c b/mm/page_isolation.c
index d1473b2..3ddc8b3 100644
--- a/mm/page_isolation.c
+++ b/mm/page_isolation.c
@@ -137,8 +137,11 @@ int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
  undo:
  	for (pfn = start_pfn;
  	     pfn < undo_pfn;
-	     pfn += pageblock_nr_pages)
-		unset_migratetype_isolate(pfn_to_page(pfn), migratetype);
+	     pfn += pageblock_nr_pages) {
+		page = __first_valid_page(pfn, pageblock_nr_pages);
+		if (page)
+			unset_migratetype_isolate(page, migratetype);
+	}

  	return -EBUSY;
  }



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]