From patchwork Wed Aug 2 15:41:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13338452 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF318C04E69 for ; Wed, 2 Aug 2023 15:42:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235230AbjHBPmK (ORCPT ); Wed, 2 Aug 2023 11:42:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234769AbjHBPl6 (ORCPT ); Wed, 2 Aug 2023 11:41:58 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF3439B; Wed, 2 Aug 2023 08:41:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=RYN7DH9joo3rTfq03kLfw85iskRMJeYrOUPHdC0m2mc=; b=VueuQORBH0Zx8oecpphGDd2a+f C5wXJWADk0ImZU6N80BupX/ZLTEluwHdf0bUw2wgbIVHzC4QM/bCJjgsnQEUhtU031a1gtB+mS3iG DTTgblzl2urUf4SSKGYW0eqzGYAHnbkFQK9ShplN/L36EJF1csgfmjTtDPks6m8MLcM2NSfBkK0yk YInd8oNc8nohhh1lAb9WMtyUjnN0afRF7aLxK2HUoGXeYbQoyvZu3JkZfcleLpxakg5nfDO3SoERw qQn+nJoxuqkTDCbHCSGJS69vnqYxfYRvoOWnioqmewoq+36B/XNMiyvu+GiTGedFDHOvVA6F1eKOM g49DmvlA==; Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qRDyw-005GFw-0I; Wed, 02 Aug 2023 15:41:50 +0000 From: Christoph Hellwig To: Al Viro , Christian Brauner Cc: 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: [PATCH 05/12] ext4: make the IS_EXT2_SB/IS_EXT3_SB checks more robust Date: Wed, 2 Aug 2023 17:41:24 +0200 Message-Id: <20230802154131.2221419-6-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230802154131.2221419-1-hch@lst.de> References: <20230802154131.2221419-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Check for sb->s_type which is the right place to look at the file system type, not the holder, which is just an implementation detail in the VFS helpers. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Christian Brauner Acked-by: Theodore Ts'o --- fs/ext4/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index c94ebf704616e5..193d665813b611 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -140,7 +140,7 @@ static struct file_system_type ext2_fs_type = { }; MODULE_ALIAS_FS("ext2"); MODULE_ALIAS("ext2"); -#define IS_EXT2_SB(sb) ((sb)->s_bdev->bd_holder == &ext2_fs_type) +#define IS_EXT2_SB(sb) ((sb)->s_type == &ext2_fs_type) #else #define IS_EXT2_SB(sb) (0) #endif @@ -156,7 +156,7 @@ static struct file_system_type ext3_fs_type = { }; MODULE_ALIAS_FS("ext3"); MODULE_ALIAS("ext3"); -#define IS_EXT3_SB(sb) ((sb)->s_bdev->bd_holder == &ext3_fs_type) +#define IS_EXT3_SB(sb) ((sb)->s_type == &ext3_fs_type) static inline void __ext4_read_bh(struct buffer_head *bh, blk_opf_t op_flags,