From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 6B77CC43381 for ; Thu, 11 Mar 2021 12:20:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 33ABE64FD9 for ; Thu, 11 Mar 2021 12:20:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233111AbhCKMT4 (ORCPT ); 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.