Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1155886rwo; Wed, 2 Aug 2023 09:28:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlENPe922hPWESqydw0pZzfL01ix7iFXqhGtTXoZNWZXy4HWmuD8qPmSTrVnlKIu67lkk71K X-Received: by 2002:a17:902:c20d:b0:1bb:9bc8:d22d with SMTP id 13-20020a170902c20d00b001bb9bc8d22dmr14676255pll.16.1690993717869; Wed, 02 Aug 2023 09:28:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690993717; cv=none; d=google.com; s=arc-20160816; b=p4LMKAGvxeCkke7/kTygTPabzdEBYMvqArD5mEcEuVtQHvOagQ69iHYrkbfSff7gZa +qlNBZabbyMziDsH/HTIPwKHMf7u2XAxD/bVkX3fVNPByf1BeryECaXt6R3FGYCDT69U TEMpFmXnhOL+bMqHt39Fxc73hUa58EGBsebtOeJMdMTocpq1RsdXXtXuXKbjpw4mdJzY 5QhWrHHvItCRPVE9vBhiFPaBXANEOtmuDOcSisJvPWj7YnGOpSTGZUBg81X2n2LNHhAw HlRwuKcYCY6KDNzLmoV07Zz8rl4VUIkeSJJ7Rsd65mQikZChsEC5T7MKj/sxcNEKECPp phdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RYN7DH9joo3rTfq03kLfw85iskRMJeYrOUPHdC0m2mc=; fh=EY4nBjRR1THbvUmIeG1UZvfGbBl7lvcJq64vCzE68S8=; b=PF3Oe7zlTXZHrZGcmoW9hXGYkCrOTq92y0GdDI3YzYkdN8Sh+EFF37HuhI4yU9qFgE uCNRNezbhhRBrvOvUvlTcQrHD939TLoH4ykZAgPFd0bh6oCqm2Zoj/ORElN00NnooMOt Sv6Gc+b2S8YllJ9kgVdsrj5N04VgqwIMoIfOEYyJNy1wBpa6F9hLKo/pI/vgwOY18Qg7 Wx3xhj5u4sH5dpGU6VsNL/CUyiPUYNdz7Qo6/pPAB9ke6pIuhz8MN9MTytHKEGP8l/qX t442ficeXFy5CS4RfHdw1VMKxRgtGChPtBEKtSFKx6tBxPG5kpOFPDphUd2HhZRvcOiI GQJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=VueuQORB; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c6-20020a170902d48600b001b7cbc58734si11495698plg.406.2023.08.02.09.28.22; Wed, 02 Aug 2023 09:28:37 -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=@infradead.org header.s=bombadil.20210309 header.b=VueuQORB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235233AbjHBPmK (ORCPT + 99 others); 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 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 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 --- 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, -- 2.39.2