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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT autolearn=unavailable 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 D34B5C31E44 for ; Fri, 14 Jun 2019 06:36:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B33A0208CA for ; Fri, 14 Jun 2019 06:36:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725801AbfFNGgT (ORCPT ); Fri, 14 Jun 2019 02:36:19 -0400 Received: from verein.lst.de ([213.95.11.211]:44446 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbfFNGgS (ORCPT ); Fri, 14 Jun 2019 02:36:18 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 50C3C68B02; Fri, 14 Jun 2019 08:35:49 +0200 (CEST) Date: Fri, 14 Jun 2019 08:35:49 +0200 From: Christoph Hellwig To: Ira Weiny Cc: Christoph Hellwig , Dan Williams , =?iso-8859-1?B?Suly9G1l?= Glisse , Jason Gunthorpe , Ben Skeggs , linux-nvdimm@lists.01.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, nouveau@lists.freedesktop.org Subject: Re: [PATCH 13/22] device-dax: use the dev_pagemap internal refcount Message-ID: <20190614063549.GK7246@lst.de> References: <20190613094326.24093-1-hch@lst.de> <20190613094326.24093-14-hch@lst.de> <20190614002217.GB783@iweiny-DESK2.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190614002217.GB783@iweiny-DESK2.sc.intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Thu, Jun 13, 2019 at 05:22:17PM -0700, Ira Weiny wrote: > > - dev_dax->pgmap.ref = &dev_dax->ref; > > I don't think this exactly correct. pgmap.ref is a pointer to the dev_dax ref > structure. Taking it away will cause devm_memremap_pages() to fail AFAICS. > > I think you need to change struct dev_pagemap as well: Take a look at the previous patch, which adds an internal_ref field to dev_pagemap that ->ref is set up to point to if not otherwise initialized.