Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp190328img; Mon, 18 Mar 2019 00:30:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyO3jnMx62gMaWaVVYrM11XdW9nHrNNysGyFa+yJo2R5+mQaoeO5lxaaWy/wloatEpwC26G X-Received: by 2002:aa7:811a:: with SMTP id b26mr17463752pfi.250.1552894244376; Mon, 18 Mar 2019 00:30:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552894244; cv=none; d=google.com; s=arc-20160816; b=NLo6pMwYI9BH35BQv+0SOaZh7AFKQskKau7nD+vQksYOUJXzy6G1Y0GfROUhk8gu62 C5U4TYOZZLchDzl2Q7wC6K41aU3J74OCdBD7s1YtskoxdaiWomspiJjTfya7q1qxWgeK LnkRj4HurqFrrZgzVv7qIfGE6rYkVK1fVTZBu+PlJNgOPoxyRpXHSf9bugW9Z1Flzq7h p2Fgj5xvyTJ0hrd+w8G4dTneHFaXpsaPZE6OS2JRB6BDlfN+Um58Wnb8rR9l9TF7YFI4 knkeW241L5G4197Vvvb4raKTHUDKefACvUGCfQ/gomtrWauVkBDIDCKDG6B/3Js0kE99 DVNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=DWFtiZPjoRjiWvPt/gIzocfW/ZQPI6hXRK4YSyrSrUs=; b=CaPTN8u2QskOuLQ5+kP97FnQechUujw2zjZPFfMuxgq9X8HnvKSDYksB2ZJcnywngf LkaGN8zMf4HoHi+53e2igzM+MG+rhYON0UXB8qF8x1LOWhBIGKkrMFUoIrf8e5Ohm9Xp 4X1ch5OMo5nCBVnXhGvhYAumXWMAu7NtWtCHMRhsrd6toF1/NoUnBckBChR3B9Lu2R2p 8bXt8cmXNiiTUXLiYJCPO1NfYdvAndpqFpAzVnViLqXfiCkTaZFYjM8V9LkeicIwOsNE 01KCmPQvm0QcnuDrX7c2qhbBdlv5cD65K/Qm3MMxK2EuvOcAdp9u57dYDjIn7zT7k1vU 4psw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s7si9029838pfb.153.2019.03.18.00.30.29; Mon, 18 Mar 2019 00:30:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727047AbfCRH3w (ORCPT + 99 others); Mon, 18 Mar 2019 03:29:52 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:50525 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726135AbfCRH3w (ORCPT ); Mon, 18 Mar 2019 03:29:52 -0400 Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Mon, 18 Mar 2019 08:29:51 +0100 Received: from d104.suse.de (nwb-a10-snat.microfocus.com [10.120.13.201]) by emea4-mta.ukb.novell.com with ESMTP (NOT encrypted); Mon, 18 Mar 2019 07:29:44 +0000 From: Oscar Salvador To: akpm@linux-foundation.org Cc: mhocko@suse.com, anshuman.khandual@arm.com, william.kucharski@oracle.com, hughd@google.com, jack@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Oscar Salvador Subject: [PATCH v2] mm: Fix __dump_page when mapping->host is not set Date: Mon, 18 Mar 2019 08:29:31 +0100 Message-Id: <20190318072931.29094-1-osalvador@suse.de> X-Mailer: git-send-email 2.13.7 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Swap mapping->host is NULL, so let us protect __dump_page() for such cases. Fixes: 1c6fb1d89e73c ("mm: print more information about mapping in __dump_page") Signed-off-by: Oscar Salvador Acked-by: Michal Hocko --- mm/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/debug.c b/mm/debug.c index c0b31b6c3877..7759f12a8fbb 100644 --- a/mm/debug.c +++ b/mm/debug.c @@ -79,7 +79,7 @@ void __dump_page(struct page *page, const char *reason) 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); -- 2.13.7