Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1189872rwo; Wed, 2 Aug 2023 10:00:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlGuvRcoY46ulwJGOsUxiebEoKd52p6UMAwCg3C2aWn2vzLY2S/bk+h32wylO8vPuNqRChua X-Received: by 2002:a19:915c:0:b0:4f8:5e8b:5ec8 with SMTP id y28-20020a19915c000000b004f85e8b5ec8mr5017135lfj.9.1690995623775; Wed, 02 Aug 2023 10:00:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690995623; cv=none; d=google.com; s=arc-20160816; b=yrzHmaKnge91hlfynT9f1t3wNwqY5WzbC3x0kQxk7YknyVbCXG9PC1JrSF+J/o/d3O dYys9FaBAP453xFZZBLMMnugoTm4Wsd/Ks4YiW5mAge4A4fupu3iZAczhSR7QuI7tmD6 UO9Avity99TaDyp9vtdbhV9VeRPsGcYX96eWJDSdk1mOuUcM95nfcTspe1qN0YNBZAVi mkE74dQoOHlLhF3BU3oCRzkh0rHrLrOGGnEzUWBNnuqEKBQl6vUY7YZXLJZyWAOjwplL zq00J5itMubxs8vIH5u6vN9jTyOjliPjdOg5hl6gMnJ2G4jXccKizNJT1bt72ZclPTOx rH0w== 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=hoDXqXS3qmSQoEAHWNB0AO6Jg7bbIoxeE3c0cwIdaqg=; fh=x/YWOk/H1gK2M7rG7DzCw7KZxNf5q01TAKGp21Td7Vw=; b=hnEhdCNuEsEqSERySJgn9WaJcSJmXKW9h7JZD6rD6zSM5MQK0u6ig2D5gcFGTeDLto Grm1EmMl+1fO3QV0BkjOkIsRdy/QlKfLSvuW83KU6Spdyxkl+I7mrV9QX1GHQo3fpXoO r1dazSPFRzKh1YWm7tIhPijDT1UcgY7m4rJ2lmEeJhiFIzypB5IgcJL9sX3RvlWX7cBA SM4hXhHntwdujx+PwUSV4tG0fyRFFNJFLTA493lrnyayusHww/xfyMUll2vCyoUqCiqU rmByFviezLGhE8sHAhZpD/N9D2oWCqpgj0JQoYkH8MPK/9AiIKVu+O9Vr144kdnxUkwQ 8kKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VbhXgLKw; 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 m21-20020a056402051500b0052259e83d42si10453725edv.34.2023.08.02.09.59.58; Wed, 02 Aug 2023 10:00:23 -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=VbhXgLKw; 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 S232525AbjHBQdX (ORCPT + 99 others); Wed, 2 Aug 2023 12:33:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232394AbjHBQdW (ORCPT ); Wed, 2 Aug 2023 12:33:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93BF12101; Wed, 2 Aug 2023 09:33:21 -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 329C761A24; Wed, 2 Aug 2023 16:33:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8773FC433C7; Wed, 2 Aug 2023 16:33:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690994000; bh=U5pXU2c37LOZ29omq1nYjOha2+PkFnv5cZZI28wk6xI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VbhXgLKwgsrsAQ9lKMSn42pa4Ylk6IKQnzpDE7eTo6XWu8QXA8ASoiiWUp5vePHa4 rqKYL37JGUX9BYkCAq6Qa8f7fGtfFLzcMqz+eu6fI8dgYR1AAcKZIwk67k6sSHEK5a Njz82jH8Ug+YQ2Q1h4sDTGfhQcEv4iGu0G/SVUWQa2Pt/MuSQ64lm77P0GczVG9m1Q DKM8m4hoED2p4UVsLydshoE+nAb2SHTV3Q+EDW0nZpH+Ge1CA1glHR2oD3mFU2ZrFO Onx7JmBXl+uQCY9uDiWr6KaBHqsgZYWYOWiRpEIGfLcVhIwvH7UOPO/1IFtwzm3fow kufdy4/TMWpFw== Date: Wed, 2 Aug 2023 09:33:20 -0700 From: "Darrick J. Wong" 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 , 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: <20230802163320.GX11352@frogsfrogsfrogs> 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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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-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 Nice cleanup, Reviewed-by: Darrick J. Wong --D > --- > 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 >