Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp39722pxw; Thu, 7 Apr 2022 23:56:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaXVhjcpfxM4u69/f7GnoJIzgYCi/6y3Gw+/3PY6HyLP9c3B/SAwbHrPgi9yBQNB+G+C2j X-Received: by 2002:a65:56cb:0:b0:378:82ed:d74 with SMTP id w11-20020a6556cb000000b0037882ed0d74mr14427625pgs.491.1649401009861; Thu, 07 Apr 2022 23:56:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649401009; cv=none; d=google.com; s=arc-20160816; b=VZ2aF0xuA7P4E9gdw1SX3EHrNeE2eoa1pHVgSX4vlnRJTwFt69Al2dhOD7oK+aGP3r 2PihD4WUhB4H5g58zyOJa3jh3tEudHm1p0P56rUui0OIz05r5N8H180xywWqZ+4t3uJx pD79KRGHsXBj07cVngP9U8XfbdzQjznM6EClSAmyNpMQtgiqVoK+LoQiIrqUtnjUTsf6 8UnaMHPEEMIH7DRY/Ao2mw/hAOHy/+ASY9ez6S7npgGWCTcpdD+MbzwbpoTwftYSbxEl Xi1AkefEDl90RK3UpS6uKc04hlJxSND7FAG3XpkCXiQiRp7wNajXqsMGjmaBnG602k/i Q6/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=g35dmgX32k/R7TxnuKRf02cyb1nmI23wQu6jsuLVbVU=; b=fmHwEIAS0w48BbG2QTJV/P8TQHnOBGd2cvmuByw+PPSyM7qswyWXAet/xVyGlDF4Oc 7fC2LJH3g62SlL5bp9bRHBLovV1y6r5nOz0dED3vuEuH+ur4Iy3mTycdTlgzaVHPJ+5b 4DAAoh373fIzD9NeIV/Zc0Rzwr5v1Uapifh1M0U5LMPtoH+/VI+/sZyw+rZSYDGIyOLV +uSdnHajiXlN/HFyPPnZ/GfA1rqFEbFLwup1LbRIa9516jm8JOfYSEshmHvzOl8odzkh yH3kKeMG61szLDf3oeNW4KSJwoPPFGeEmL0XsAWN6yIfQ6JGXy3ZHkdtOeVA2ym8VR+t egow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20210112.gappssmtp.com header.s=20210112 header.b=wlSIBbbS; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id oc9-20020a17090b1c0900b001cb1d512cb8si3684130pjb.50.2022.04.07.23.56.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 23:56:49 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20210112.gappssmtp.com header.s=20210112 header.b=wlSIBbbS; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5BCC51A9CB9; Thu, 7 Apr 2022 23:26:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232856AbiDHG2Y (ORCPT + 99 others); Fri, 8 Apr 2022 02:28:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232627AbiDHG2W (ORCPT ); Fri, 8 Apr 2022 02:28:22 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46393198534 for ; Thu, 7 Apr 2022 23:26:19 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id h5so6014706pgc.7 for ; Thu, 07 Apr 2022 23:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=g35dmgX32k/R7TxnuKRf02cyb1nmI23wQu6jsuLVbVU=; b=wlSIBbbSFHb+JhPPPwZhYXbD7WTAYzJ9ooeCOJ4TJorGTR9S6YbwY6kt+RuyigO524 kMvXQrASEbH6rcmScjaHvcogjfqkb8NJlfaBW2HLpnN56HWsI5uwggQ+dYV/aoIepw/E nURCc8MnNjmA0kvJ5xVOTCAndDTK2kjR54OW2WJBfuINbnBPEn1OXIKcmO1sLyaob2Ed 9WV7jQkkHpFjZGrAf5cVdT00/H55NyENNDR9ohZpO6Hq09QYEVUxnOtII9fZ0Q0VRD+x sv0Gji5mFmzwSVQRwIxHosZoXz1DCVg7lzTFeipG8MZ1kmYnGngZUkUnKri1pi1o27UQ FLEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=g35dmgX32k/R7TxnuKRf02cyb1nmI23wQu6jsuLVbVU=; b=A3YQofI2npV2IgWpi5v2KG3eBmP3VFWM0sjWw3hwhzH787dJdYh8mwjiXXGhuL/Lnj FBXsIjm4Vq+g5mUEO+59D8cuFChg6rMde4K2fYRozw+Zl33wlpvsDDPtWu2R9DD7K3l7 U8M+MCLa1s5FP8OxIXefPj495b7QduOr9rXDs+jYLBaVNLz7b1mVtB65/uEplcXo7JCV z0c2I6CVko/EMLvpVUxuGvKEUDs45hEcuJ4z0XMxZZT5XW9at9Z0mtwhXTy5bQwVUmno Arb7x83vVFtVP3gOZrJbXWl2UvrDDdYgCe8ruQ3INIt7+0spMSstcaaAPFaFrmwANIro iSZA== X-Gm-Message-State: AOAM530bIUlkR1Jbv/Pj42cMCce/o/H8lnbyfNfTju4/BVDPJY93mU04 DCybg3n2gw4uCbpa1oTri3lpZD7PVVveWRjly2Hvcw== X-Received: by 2002:a05:6a00:8c5:b0:4fe:134d:30d3 with SMTP id s5-20020a056a0008c500b004fe134d30d3mr18016783pfu.3.1649399178836; Thu, 07 Apr 2022 23:26:18 -0700 (PDT) MIME-Version: 1.0 References: <20220227120747.711169-1-ruansy.fnst@fujitsu.com> <20220227120747.711169-8-ruansy.fnst@fujitsu.com> <8f1931d2-b224-de98-4593-df136f397eb4@fujitsu.com> In-Reply-To: <8f1931d2-b224-de98-4593-df136f397eb4@fujitsu.com> From: Dan Williams Date: Thu, 7 Apr 2022 23:26:08 -0700 Message-ID: Subject: Re: [PATCH v11 7/8] xfs: Implement ->notify_failure() for XFS To: Shiyang Ruan Cc: Christoph Hellwig , Linux Kernel Mailing List , linux-xfs , Linux NVDIMM , Linux MM , linux-fsdevel , "Darrick J. Wong" , david , Jane Chu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Thu, Apr 7, 2022 at 11:05 PM Shiyang Ruan wrot= e: > > > > =E5=9C=A8 2022/3/30 14:00, Christoph Hellwig =E5=86=99=E9=81=93: > >> @@ -1892,6 +1893,8 @@ xfs_free_buftarg( > >> list_lru_destroy(&btp->bt_lru); > >> > >> blkdev_issue_flush(btp->bt_bdev); > >> + if (btp->bt_daxdev) > >> + dax_unregister_holder(btp->bt_daxdev, btp->bt_mount); > >> fs_put_dax(btp->bt_daxdev); > >> > >> kmem_free(btp); > >> @@ -1939,6 +1942,7 @@ xfs_alloc_buftarg( > >> struct block_device *bdev) > >> { > >> xfs_buftarg_t *btp; > >> + int error; > >> > >> btp =3D kmem_zalloc(sizeof(*btp), KM_NOFS); > >> > >> @@ -1946,6 +1950,14 @@ xfs_alloc_buftarg( > >> btp->bt_dev =3D bdev->bd_dev; > >> btp->bt_bdev =3D bdev; > >> btp->bt_daxdev =3D fs_dax_get_by_bdev(bdev, &btp->bt_dax_part_off= ); > >> + if (btp->bt_daxdev) { > >> + error =3D dax_register_holder(btp->bt_daxdev, mp, > >> + &xfs_dax_holder_operations); > >> + if (error) { > >> + xfs_err(mp, "DAX device already in use?!"); > >> + goto error_free; > >> + } > >> + } > > > > It seems to me that just passing the holder and holder ops to > > fs_dax_get_by_bdev and the holder to dax_unregister_holder would > > significantly simply the interface here. > > > > Dan, what do you think? > > Hi Dan, > > Could you give some advise on this API? Is it needed to move > dax_register_holder's job into fs_dax_get_by_bdev()? Yes, works for me to just add them as optional arguments.