Re: [PATCH] hwpoison: always unset MIGRATE_ISOLATE before returning from soft_offline_page()

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

 



On Thu, Aug 22, 2013 at 03:20:47PM -0400, Naoya Horiguchi wrote:
>Soft offline code expects that MIGRATE_ISOLATE is set on the target page
>only during soft offlining work. But currenly it doesn't work as expected
>when get_any_page() fails and returns negative value. In the result, end
>users can have unexpectedly isolated pages. This patch just fixes it.
>

Reviewed-by: Wanpeng Li <liwanp@xxxxxxxxxxxxxxxxxx>

>Signed-off-by: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx>
>---
> mm/memory-failure.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/mm/memory-failure.c b/mm/memory-failure.c
>index af6f61c..1cb3b7d 100644
>--- a/mm/memory-failure.c
>+++ b/mm/memory-failure.c
>@@ -1550,7 +1550,7 @@ int soft_offline_page(struct page *page, int flags)
>
> 	ret = get_any_page(page, pfn, flags);
> 	if (ret < 0)
>-		return ret;
>+		goto unset;
> 	if (ret) { /* for in-use pages */
> 		if (PageHuge(page))
> 			ret = soft_offline_huge_page(page, flags);
>@@ -1567,6 +1567,7 @@ int soft_offline_page(struct page *page, int flags)
> 			atomic_long_inc(&num_poisoned_pages);
> 		}
> 	}
>+unset:
> 	unset_migratetype_isolate(page, MIGRATE_MOVABLE);
> 	return ret;
> }
>-- 
>1.8.3.1
>
>--
>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>

--
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]