Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2503918rdg; Mon, 14 Aug 2023 04:58:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9VAcU5iiyNM7zmiWI3idOuL+J3HkdJH8QYOGhcchoUCTbJdu/SqGNsAJ8HKhHm5yqRBiD X-Received: by 2002:a17:906:2d1:b0:99c:6651:2ab7 with SMTP id 17-20020a17090602d100b0099c66512ab7mr7387482ejk.57.1692014316885; Mon, 14 Aug 2023 04:58:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692014316; cv=none; d=google.com; s=arc-20160816; b=vBvp60bpbt9QFsFm2O8QFMH6CTbi5B08Z3r+AXFD9BT72P9eofeNbOtBDPkTI03pDf yrMaz7Qcf4JYegEZHbxJRMFvVV6HPBSYeS7tp8wXObtwQT47oPCu83Atoh3bTxF7NAAs 6pm+sqcktl2eWPbneHQc3pay6s0XYMo+4ZTSe/kpJFJZv2DKtM4R4sEBGtRbDpL6sLx2 Tj87EIrdZoHJ7DGYApa/Ht6c31ovVJRvAs3NQ/gGdk3ziUaCEHCrcmlQByypfT3oCAuC JHkcUfD2Bh13w8rmup1wIxisjpm9DTunPQzVtyWt4a0MnJvLhuMGvPF6XZiU4TOyn8uO R9jg== 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=hsCCgiHaixdQOsxniPqKPHOMdwvJO/L64YX+/lrwqIo=; fh=yowWURD42+DWy4y8UqesD/TDBZB56Ld5UVTyKuHhLrg=; b=rlOaGuC08lJpy+snRdqjJ/UH+9hs4E5beh0Qq6HdP+eMoAAHIPt99T4Yb0aUiVDiRo /g0XS2+E8AFHsbkSgWxqwi0AkqhpSph9/ENqHuGWcAUKrH6hHEVwXC4qyfvGr0IzbMcu IHPoX9WysUevfSKZaurOOOAM2XPbGTQpxUjewQEw9QdCvn6dCcBAUSuVbHq66vUfZoFP AYCJ2Ppfy1gyED9NX4bAZLN8p7JAJseD0K5lBGXkReFB7QuoaxFoEOtYsfJwr5EqH/2M i7a+45u61mhhVBZoJX9/iJw89pTKzo4oN/cLhRNd+JO+tZWmCiN+NBzZL/aYWdoLbygS BKKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bIay++Zk; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ks13-20020a170906f84d00b00992b75d594csi8077063ejb.317.2023.08.14.04.58.10; Mon, 14 Aug 2023 04:58:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@kernel.org header.s=k20201202 header.b=bIay++Zk; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233707AbjHNLF5 (ORCPT + 99 others); Mon, 14 Aug 2023 07:05:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbjHNLF2 (ORCPT ); Mon, 14 Aug 2023 07:05:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F19A1B5; Mon, 14 Aug 2023 04:05:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9505F63C48; Mon, 14 Aug 2023 11:05:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D8AAC433C7; Mon, 14 Aug 2023 11:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692011127; bh=o2GX9ktf7XmPbMjQ9eJQ/RJAYkU4u146tdoCQwdGLb0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bIay++Zk8I7jdq3aa314BvqvMSwSTvUrpfQ7qiM3lFepfXfKvkyxKw+ScOHOeNAeF swv1N35AaYHTsafue1ph47qRvF4v7/WNS4m6C/vyxo5D8YlSLO7aA3cWTsuhPBBc5n LB+rxQtjAurAl+RNPoAAUTKinsrT3dSVXbCaXI4wxEsLhMQzqaX9UtRxoIsUj5gxfY +H3DHAZWgwJJoUhMVb9xrAz/MBkCw+eE9/jjoA6eBhWtNlCNXNEfgNI/4TVQRrEk3+ iMkeR/oOvgPUnvMrLBKF2FjWxg11L6xc3ZZzJ4Tt6uXZBsaEqVGQza9pz0gzmiarsL wVtCOM+YmdytQ== Date: Mon, 14 Aug 2023 13:05:19 +0200 From: Carlos Maiolino To: Christoph Hellwig Cc: Al Viro , Christian Brauner , Jan Kara , Chris Mason , Josef Bacik , David Sterba , Theodore Ts'o , Andreas Dilger , Jaegeuk Kim , Chao Yu , Ryusuke Konishi , "Darrick J. Wong" , Jens Axboe , linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nilfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-block@vger.kernel.org Subject: Re: [PATCH 12/12] xfs use fs_holder_ops for the log and RT devices Message-ID: <20230814110519.i4vjdomisjrez3r3@andromeda> References: <20230802154131.2221419-1-hch@lst.de> <20230802154131.2221419-13-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230802154131.2221419-13-hch@lst.de> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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-ext4@vger.kernel.org On Wed, Aug 02, 2023 at 05:41:31PM +0200, Christoph Hellwig wrote: > Use the generic fs_holder_ops to shut down the file system when the > log or RT device goes away instead of duplicating the logic. > > Signed-off-by: Christoph Hellwig Reviewed-by: Carlos Maiolino Carlos > --- > fs/xfs/xfs_super.c | 17 +++-------------- > 1 file changed, 3 insertions(+), 14 deletions(-) > > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c > index d5042419ed9997..338eba71ff8667 100644 > --- a/fs/xfs/xfs_super.c > +++ b/fs/xfs/xfs_super.c > @@ -377,17 +377,6 @@ xfs_setup_dax_always( > return 0; > } > > -static void > -xfs_bdev_mark_dead( > - struct block_device *bdev) > -{ > - xfs_force_shutdown(bdev->bd_holder, SHUTDOWN_DEVICE_REMOVED); > -} > - > -static const struct blk_holder_ops xfs_holder_ops = { > - .mark_dead = xfs_bdev_mark_dead, > -}; > - > STATIC int > xfs_blkdev_get( > xfs_mount_t *mp, > @@ -396,8 +385,8 @@ xfs_blkdev_get( > { > int error = 0; > > - *bdevp = blkdev_get_by_path(name, BLK_OPEN_READ | BLK_OPEN_WRITE, mp, > - &xfs_holder_ops); > + *bdevp = blkdev_get_by_path(name, BLK_OPEN_READ | BLK_OPEN_WRITE, > + mp->m_super, &fs_holder_ops); > if (IS_ERR(*bdevp)) { > error = PTR_ERR(*bdevp); > xfs_warn(mp, "Invalid device [%s], error=%d", name, error); > @@ -412,7 +401,7 @@ xfs_blkdev_put( > struct block_device *bdev) > { > if (bdev) > - blkdev_put(bdev, mp); > + blkdev_put(bdev, mp->m_super); > } > > STATIC void > -- > 2.39.2 >