Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp773675pxr; Mon, 11 Apr 2022 06:58:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyw5LM8KNkXsAb+yzrLUiiIBJZgXSg/96f37gZHaaV6B0+Q6ODNB9T5tde4hR79jASuCzTL X-Received: by 2002:a17:90a:cd06:b0:1cb:8c74:2baf with SMTP id d6-20020a17090acd0600b001cb8c742bafmr7650663pju.214.1649685489289; Mon, 11 Apr 2022 06:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649685489; cv=none; d=google.com; s=arc-20160816; b=Hg6IPIFlN/xG2LbTunHqfNf18m/bWx7TwXYI1RF3BP8iR9polMw6gW1MZnpMI1x7xs L9QHahKyQiavMeeZz+LevmzrhdTMfKLN0XHzIi+A4wEcGn4FH5sWPIBU82ZDmkBTD4D3 YIpxWYcgDRFbSwSP469iRzwZWzmUQrGGp+h3oZWSxJFledNFFeVYq+YG5E4CtRpGGpZG 8dKqfr95Si+HKlgZDAR4WJsvsXnjDD0zSywbB5JC7RBjNF4i4+s+Xx/UqYXqZEyjBf6q P/hT23GJGJCSn2WlaeBHNnd/B7B9cuzgPFtD0MPEOFvG1fwPSNB00SMx43Zj5tp2ROs6 h/aw== 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=21mNC1xMcb143QvqEDow7m5pUs/f8C5BnuVHx811IUY=; b=miRfVktFsSS7n/5iQgXguHdfHjVRNBuRyMcfxi688FYKGgXrkTk8Wvq7FPEuz1JZeU gQxgtk697ZE5722bdkJtRDbMgnq7glU/phT4rwJjhhCn55hbFtdzWojXWm/7CnKP62ny C1JvZbwfN8h8NEiTozKEe6W9PL0ZwLWmRUILp5bc1C5PWlgjRMKoMohhELSZ3Mxe4mcB 2xgLkYl2Wpib4IKyI8CavNvIrqfzFfRw42Rxfjai4/z84ikQh9EBTQ8vXAHN9TlWt5/u QTaNj/WGNJy8Gy6t3POsNnkYfGK5kGObvfBmwk1HSfzYttVZrMBeE0uPJPENSG801QZE g7vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="OyrX/F9/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s5-20020a170902b18500b0015873700316si1326583plr.45.2022.04.11.06.57.54; Mon, 11 Apr 2022 06:58:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="OyrX/F9/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245193AbiDKHIi (ORCPT + 99 others); Mon, 11 Apr 2022 03:08:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244992AbiDKHIe (ORCPT ); Mon, 11 Apr 2022 03:08:34 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D322D33A1A; Mon, 11 Apr 2022 00:06:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=21mNC1xMcb143QvqEDow7m5pUs/f8C5BnuVHx811IUY=; b=OyrX/F9/CkEzV2AJPytb9wOZe/ xVlVjM4Mv9OnTKyiF6cpVh+Lwn0P7HwhNa3rYDlLij84mntPBmNs9LvVI7aROjv7wQu6m79nP2LRi I9jTbJMDqly7aZfSfm7/ONz0mxcoBk3vPSbBZ0sdEQEmXpJTeodLum0KIib5NP53Lp+b6ljFbJPzX E18EpZvaJnzlFZwIvexozxCxHxwIIQ4ncxaopxsiiYs38YUzYCuMVa9SUmCWxzjK0yhdecVOv7zFM N7FcPgI4h26a1A3ZDKlLYdg6O0Cp67bEI/Jyc80MlsDU+Wi8R0fvARRVPQjbhDI4e/niO8gq0/08Z 9jWhlbFw==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndo7t-0075f9-59; Mon, 11 Apr 2022 07:06:17 +0000 Date: Mon, 11 Apr 2022 00:06:17 -0700 From: Christoph Hellwig To: Shiyang Ruan Cc: linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, nvdimm@lists.linux.dev, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, djwong@kernel.org, dan.j.williams@intel.com, david@fromorbit.com, hch@infradead.org, jane.chu@oracle.com Subject: Re: [RFC PATCH] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind Message-ID: References: <20220410171623.3788004-1-ruansy.fnst@fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220410171623.3788004-1-ruansy.fnst@fujitsu.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 11, 2022 at 01:16:23AM +0800, Shiyang Ruan wrote: > diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c > index bd502957cfdf..72d9e69aea98 100644 > --- a/drivers/nvdimm/pmem.c > +++ b/drivers/nvdimm/pmem.c > @@ -359,7 +359,6 @@ static void pmem_release_disk(void *__pmem) > struct pmem_device *pmem = __pmem; > > dax_remove_host(pmem->disk); > - kill_dax(pmem->dax_dev); > put_dax(pmem->dax_dev); > del_gendisk(pmem->disk); > > @@ -597,6 +596,8 @@ static void nd_pmem_remove(struct device *dev) > pmem->bb_state = NULL; > } > nvdimm_flush(to_nd_region(dev->parent), NULL); > + > + kill_dax(pmem->dax_dev); I think the put_dax will have to move as well. This part should probably also be a separate, well-documented cleanup patch.