Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp301431pxf; Thu, 11 Mar 2021 04:21:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNMIeAIsrKB9istwAgn4Gvrwc5rgOWpWvMyvJO7X6ZEsA4Q0WRV32CAeUewWPwpaO9UXbw X-Received: by 2002:a17:906:4c85:: with SMTP id q5mr2787604eju.375.1615465313034; Thu, 11 Mar 2021 04:21:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615465313; cv=none; d=google.com; s=arc-20160816; b=MLuQAmkFVIfdvoCKW126WHGGTwN9JfSoW8cw/6VRMuPGVrd04VxlE+/VfXQdmGzJU8 wirjJzQLl8DB5yHJ7FwCxwMs2aZQDzO5k+J/wncieV4AhxSWGeMKnYEE9fNQD2jFCPWn +d5ZD0lu+MppocD4yubb+mvgYYfn1r3II7731Nx6kiOIItvipmMeuRJbnCh1jZIFaGT4 kpRNvUckNFOHxENeF8aOkc2/nzaJEEjUhhPXmp8B6/kn321kyU9Vf6bVqcwM8iGhlXHz kNrORWcJdd1kTJ5ZgnAFh8r0o2KCgpWbiyl1HrlL+vOo+bF9Yi+37jVCn8c9tzXFwuaJ GlKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XlQyuboYgzWxooTeci4Rog66BxxnzDAehcID4SPIFSo=; b=g1JR0cVvrrTTa13Bj0vpvgEhEQXpbHfs3WGbbi25xtr+seHNkfQ44rYlqONuo+QtR/ bkKimp5xkVCUYV+6jfxq8y2zF+LDWxXnP2b/vVR/At50l9BXyYHcJOmrTLOKJVQ0SvYz i0bIhRjj2s6600NH346NHWu4CubWymMUYm4KNxqoiq5TKQOoOnPSQkZG6wLbe2V7+YZW 9cLZbbE3o+Cbf8U0GR3uzea+L/1HjQ1nJrRl2CityXu7TAOQHh1Wbb5XGz0MaIB8Yu85 X5dSCnPDnEcph0yK0SXYsOQu8wu67rtNSlk8Dj46fjoD5iYrZIcVwGOX6q1ubmEfsrGa MbYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=v3njQKea; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c13si1631350ede.115.2021.03.11.04.21.30; Thu, 11 Mar 2021 04:21:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=v3njQKea; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233104AbhCKMT4 (ORCPT + 99 others); Thu, 11 Mar 2021 07:19:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232781AbhCKMTs (ORCPT ); Thu, 11 Mar 2021 07:19:48 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44CF6C061574; Thu, 11 Mar 2021 04:19:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=XlQyuboYgzWxooTeci4Rog66BxxnzDAehcID4SPIFSo=; b=v3njQKeaX4Pbb8Na4hXs0oFO/e 78jdKnI1IOuKOxhZ3g1ccVJB7ixBlwgGXmXHu08AWrRoED9lAyiLyFf/Am4HTCOhNWNmgyI8P0PMI qRuBQaL2DFnAlc/Ey6GwwwRPq8MWd6bsF44emvtAr2/L+H62ofkPY5Gkj0COWaNkzfEdEvftUblMX Eis0SqnHFXuwVkAmsJkT6KlQlMfuM4BA7iBT+yy4m5ugP1okTqznhY8fsaVOomKwyzNYCQsTmAbVY aXu3P56nUabWLhncskyP8b0KtRwN6qhUFWzwKGIMQUFVvhSGIUB8gSMaswGo5sNWSbY9dQHQ3kNPf ulLJ+EPA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lKKHj-007IJR-JG; Thu, 11 Mar 2021 12:19:26 +0000 Date: Thu, 11 Mar 2021 12:19:23 +0000 From: Matthew Wilcox To: "chenjun (AM)" Cc: "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , Dan Williams , Jan Kara , "Xiangrui (Euler)" , "lizhe (Y)" , yangerkun , "zhangyi (F)" Subject: Re: [question] Panic in dax_writeback_one Message-ID: <20210311121923.GU3479805@casper.infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 11, 2021 at 07:48:25AM +0000, chenjun (AM) wrote: > static int dax_writeback_one(struct xa_state *xas, struct dax_device > *dax_dev, struct address_space *mapping, void *entry) > ----dax_flush(dax_dev, page_address(pfn_to_page(pfn)), count * PAGE_SIZE); > The pfn is returned by the driver. In my case, the pfn does not have > struct page. so pfn_to_page(pfn) return a wrong address. I wasn't involved, but I think the right solution here is simply to replace page_address(pfn_to_page(pfn)) with pfn_to_virt(pfn). I don't know why Dan decided to do this in the more complicated way.