mm/hwpoison: fix fail isolate hugetlbfs page w/ refcount held

Hugetlbfs pages will get a refcount in get_any_page() or
madvise_hwpoison() if soft offlining through madvise.  The refcount which
is held by the soft offline path should be released if we fail to isolate
hugetlbfs pages.

Fix it by reducing the refcount for both isolation success and failure.

Signed-off-by: Wanpeng Li <>
Acked-by: Naoya Horiguchi <>
Cc: <>	[3.9+]
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
1 file changed