mm/hwpoison: fix fail isolate hugetlbfs page w/ refcount held
authorWanpeng Li <wanpeng.li@hotmail.com>
Fri, 14 Aug 2015 22:34:59 +0000 (15:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 16:07:38 +0000 (09:07 -0700)
commitd73eba8c9e33c0d5b487c04a0fc498432f074fea
tree3f6ea6abd05cefb7b5c43663196229109884fcf4
parent0ebc1f07b7570ca97734c408b0ba87bf340b2cb0
mm/hwpoison: fix fail isolate hugetlbfs page w/ refcount held

commit 036138080a4376e5f3e5d0cca8ac99084c5cf06e upstream.

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 <wanpeng.li@hotmail.com>
Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/memory-failure.c