Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752061AbbHGKQz (ORCPT ); Fri, 7 Aug 2015 06:16:55 -0400 Received: from blu004-omc1s2.hotmail.com ([65.55.116.13]:50012 "EHLO BLU004-OMC1S2.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751008AbbHGKQx (ORCPT ); Fri, 7 Aug 2015 06:16:53 -0400 X-TMN: [nxopFiwB477xruKgmEG5o9Bcm/WJH0j1] X-Originating-Email: [wanpeng.li@hotmail.com] Message-ID: From: Wanpeng Li To: Andrew Morton CC: Naoya Horiguchi , Tony Luck , Andi Kleen , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wanpeng Li , Subject: [PATCH v2 1/2] mm/hwpoison: fix page refcount of unkown non LRU page Date: Fri, 7 Aug 2015 18:16:41 +0800 X-Mailer: git-send-email 1.9.1 X-OriginalArrivalTime: 07 Aug 2015 10:16:51.0839 (UTC) FILETIME=[2D8D70F0:01D0D0FA] 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: 1300 Lines: 37 After try to drain pages from pagevec/pageset, we try to get reference count of the page again, however, the reference count of the page is not reduced if the page is still not on LRU list. This patch fix it by adding the put_page() to drop the page reference which is from __get_any_page(). Cc: # 3.9+ Acked-by: Naoya Horiguchi Signed-off-by: Wanpeng Li --- v1 -> v2: * add Cc stable mm/memory-failure.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index c53543d..23163d0 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1535,6 +1535,8 @@ static int get_any_page(struct page *page, unsigned long pfn, int flags) */ ret = __get_any_page(page, pfn, 0); if (!PageLRU(page)) { + /* Drop page reference which is from __get_any_page() */ + put_page(page); pr_info("soft_offline: %#lx: unknown non LRU page type %lx\n", pfn, page->flags); return -EIO; -- 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/