Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13264C43381 for ; Mon, 1 Apr 2019 20:38:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D582B2133D for ; Mon, 1 Apr 2019 20:38:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554151100; bh=7XugP+rj5iOqFOF8WaC7xRZ5GIqmbt13hSeMzCshHII=; h=Date:From:To:Subject:List-ID:From; b=wKFSI9kTp9l1oh1exhMjjLjOTjajyuMETz61HVickIMYS8wuawHoTb9iO4RCFtXh7 npuZ6h3sYP5cs7Ej86hujXMQyJirgCk4hIiNbYvs7iHl9yvPVLYjmUAysF1/3FbfD/ R5lM5EhZ3zcO7OEGJPAnr0BDPdccXyFr4FPTvo4c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726008AbfDAUiU (ORCPT ); Mon, 1 Apr 2019 16:38:20 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47256 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725878AbfDAUiU (ORCPT ); Mon, 1 Apr 2019 16:38:20 -0400 Received: from localhost.localdomain (c-71-198-47-131.hsd1.ca.comcast.net [71.198.47.131]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 29FFAEBF; Mon, 1 Apr 2019 20:38:19 +0000 (UTC) Date: Mon, 01 Apr 2019 13:38:18 -0700 From: akpm@linux-foundation.org To: hughd@google.com, mhocko@suse.com, mm-commits@vger.kernel.org, osalvador@suse.de, stable@vger.kernel.org Subject: [merged] mm-fix-__dump_page-when-mapping-host-is-not-set.patch removed from -mm tree Message-ID: <20190401203818.-lY987Mo6%akpm@linux-foundation.org> User-Agent: s-nail v14.8.16 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch titled Subject: mm/debug.c: fix __dump_page when mapping->host is not set has been removed from the -mm tree. Its filename was mm-fix-__dump_page-when-mapping-host-is-not-set.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: Oscar Salvador Subject: mm/debug.c: fix __dump_page when mapping->host is not set While debugging something, I added a dump_page() into do_swap_page(), and I got the splat from below. The issue happens when dereferencing mapping->host in __dump_page(): ... else if (mapping) { pr_warn("%ps ", mapping->a_ops); if (mapping->host->i_dentry.first) { struct dentry *dentry; dentry = container_of(mapping->host->i_dentry.first, struct dentry, d_u.d_alias); pr_warn("name:\"%pd\" ", dentry); } } ... Swap address space does not contain an inode information, and so mapping->host equals NULL. Although the dump_page() call was added artificially into do_swap_page(), I am not sure if we can hit this from any other path, so it looks worth fixing it. We can easily do that by checking mapping->host first. Link: http://lkml.kernel.org/r/20190318072931.29094-1-osalvador@suse.de Fixes: 1c6fb1d89e73c ("mm: print more information about mapping in __dump_page") Signed-off-by: Oscar Salvador Acked-by: Michal Hocko Acked-by: Hugh Dickins Cc: Signed-off-by: Andrew Morton --- mm/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/debug.c~mm-fix-__dump_page-when-mapping-host-is-not-set +++ a/mm/debug.c @@ -79,7 +79,7 @@ void __dump_page(struct page *page, cons pr_warn("ksm "); else if (mapping) { pr_warn("%ps ", mapping->a_ops); - if (mapping->host->i_dentry.first) { + if (mapping->host && mapping->host->i_dentry.first) { struct dentry *dentry; dentry = container_of(mapping->host->i_dentry.first, struct dentry, d_u.d_alias); pr_warn("name:\"%pd\" ", dentry); _ Patches currently in -mm which might be from osalvador@suse.de are mmmemory_hotplug-unlock-1gb-hugetlb-on-x86_64.patch mmmemory_hotplug-drop-redundant-hugepage_migration_supported-check.patch