Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2490693rdg; Mon, 14 Aug 2023 04:30:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGLWMSxQEtB7+99A7yC/n1ETankrIHfHfq7dwWMGbmfH0G7V0Q7It6JcrDCxwKAibYkBuMJ X-Received: by 2002:a17:906:6988:b0:969:93f2:259a with SMTP id i8-20020a170906698800b0096993f2259amr7216649ejr.73.1692012620103; Mon, 14 Aug 2023 04:30:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692012620; cv=none; d=google.com; s=arc-20160816; b=gmPl8D3rydjsd/SYUahMjiAt+lCbrTrn/rMo+ZqvFQUOFRTcYDo7Tp9TN8pGlGbNca dVHoOp8YecSzdgSv+ep1R0CWNWCG6WDENW6OK+OtjnWox5xfyPSi1saZxD2d97pHI2dC ZzUO8A0MjKRLcoUGcFMcoSiUhhesKTtUtqQcwC7KVN9Mmu62i2INFo7jv3EZLnNEH3tl pWOTz4jKcZ9HVM0RHQsWDiwNhXJ01EbW8bnbq+/slyi0FPf3ATz0cYIwMlQTaue9+zYS m68ajrvaDeCIDFdM8seP/0oN4cwobRL2RqMKKpcz+nGHsWRrtiiUfjGIe7o/xNBiMQgo uc/A== 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=8jyqnNQl/ylK1R1JgJC5U0XdIEwZgI/c97GyfstF/eQ=; fh=yowWURD42+DWy4y8UqesD/TDBZB56Ld5UVTyKuHhLrg=; b=o+CrE9HhAIUErXte+dIVMsRtkNWKWf76R9m4jFYJj+V9egr5cu0qRX5P71ibT3z+qK CIyeUfW8C0WakkBZh0S01nK2We0engZYxK+gVgkzrdStDTH/5txCNXVr+HpYkKlOzelN IivtXjPZzsmms6iCszeHNJoZvcUF7gsyMeL0tVH/mdQ2GX70pQ9Bf0609gFlcXCq2kvc ct/LW3vKarfLX8spiCoWF1n4epsnvLFNb7uCcAFtZKcFr+jdVE2U4Hhc8hlLa85JdQd5 qYEeNMmpgpJZcrwsYEdm+jjK1Wmob/SkORpYOlkpwR72AdiJQe+1/CvBxTTLdc9IkZ+q Kc8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ada7zEq7; 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 re22-20020a170906d8d600b0098653c15e94si7599441ejb.117.2023.08.14.04.29.52; Mon, 14 Aug 2023 04:30:20 -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=ada7zEq7; 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 S233093AbjHNK7Z (ORCPT + 99 others); Mon, 14 Aug 2023 06:59:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233958AbjHNK7H (ORCPT ); Mon, 14 Aug 2023 06:59:07 -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 9698AF4; Mon, 14 Aug 2023 03:59:06 -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 2B8BD64D8C; Mon, 14 Aug 2023 10:59:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9056C433C7; Mon, 14 Aug 2023 10:58:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692010745; bh=M68BqgspvfU5HkD8cXrXN5XkVUNTnVosqqKv0zCZIIk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ada7zEq7w0DjLuBrqXHOSajouseLbVl17YndMQxL3QeWejlDOozfOtF82B8qmwNTA 7dCpOY37afZc8cxdIIJJwmBSOgHOlJ5bzVUO6YcRgJH+7pnIhpv17Z3Q7hJ1yX3twJ KOO+HncXhvEEEB5YKNR1RNqUW0wvB6HisyJDUZ2DOA+IADPGNKO10AJfDgGjU5mnji lXLQIy2a5AFWaKwNNAprmmH0HYbwbydTi3s7Ro3RoQTRznof5bS6Qjip6IN9hQwrw3 FNMGM+A0F4aRNoGmLxg9R2TwJH+atdw5/KmEhxfDPY/tZ0k7M77GLPNf0+NgB9l4gG Vu2X2xHwSn73A== Date: Mon, 14 Aug 2023 12:58:56 +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: <20230814105856.pudqvixopjh3hmtn@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 > --- > fs/xfs/xfs_super.c | 17 +++-------------- > 1 file changed, 3 insertions(+), 14 deletions(-) Looks good: Reviewed-by: Carlos Maiolino Carlos > > 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 >