Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753483AbbHJL41 (ORCPT ); Mon, 10 Aug 2015 07:56:27 -0400 Received: from blu004-omc1s27.hotmail.com ([65.55.116.38]:62971 "EHLO BLU004-OMC1S27.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753423AbbHJL4Y (ORCPT ); Mon, 10 Aug 2015 07:56:24 -0400 X-TMN: [EC0xy72SFwk2hAB/jiaFXfqcdrbd/+/W] X-Originating-Email: [wanpeng.li@hotmail.com] Message-ID: From: Wanpeng Li To: Andrew Morton CC: Naoya Horiguchi , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wanpeng Li Subject: [PATCH v2 4/5] mm/hwpoison: fix refcount of THP head page in no-injection case Date: Mon, 10 Aug 2015 19:28:22 +0800 X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439206103-86829-1-git-send-email-wanpeng.li@hotmail.com> References: <1439206103-86829-1-git-send-email-wanpeng.li@hotmail.com> X-OriginalArrivalTime: 10 Aug 2015 11:56:22.0957 (UTC) FILETIME=[93DAFDD0:01D0D363] MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1140 Lines: 34 Hwpoison injection takes a refcount of target page and another refcount of head page of THP if the target page is the tail page of a THP. However, current code doesn't release the refcount of head page if the THP is not supported to be injected wrt hwpoison filter. Fix it by reducing the refcount of head page if the target page is the tail page of a THP and it is not supported to be injected. Signed-off-by: Wanpeng Li --- mm/hwpoison-inject.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/mm/hwpoison-inject.c b/mm/hwpoison-inject.c index 5015679..9d26fd9 100644 --- a/mm/hwpoison-inject.c +++ b/mm/hwpoison-inject.c @@ -55,7 +55,7 @@ inject: pr_info("Injecting memory failure at pfn %#lx\n", pfn); return memory_failure(pfn, 18, MF_COUNT_INCREASED); put_out: - put_page(p); + put_hwpoison_page(p); return 0; } -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/