From patchwork Mon Mar 13 13:20:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhihao Cheng X-Patchwork-Id: 68838 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1187971wrd; Mon, 13 Mar 2023 06:32:57 -0700 (PDT) X-Google-Smtp-Source: AK7set/EyM3cz3CxWPSpLfLWZ2ht2k+bj5jzKoXzJxjPO4gg/JO7HH+8V+hAy05EP1VrwACjEJdC X-Received: by 2002:a05:6a21:33a2:b0:cd:97f3:25e1 with SMTP id yy34-20020a056a2133a200b000cd97f325e1mr45194302pzb.51.1678714377095; Mon, 13 Mar 2023 06:32:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678714377; cv=none; d=google.com; s=arc-20160816; b=SC4J9s1SDHElVT47MR4i8ZSTyCQ1dQBSBV9ZieDlb3YUB5A5GIAxLkfmOvn5oMb0bP kIcJfqthQ0NXwxOKyn34lpAOHo6iWkp/tsLpckTsx8xpSQU1rxSJuk6nKPTNi6ZIbfRu 1YVwoLvVpENhe0Xv3YuIk5GjytCq3vWvkkKP17uS8p+rzTLD6iNWBJSiNXBA10YPQ1z1 wWppAIbdTpY7bdiFPomx64P7Vu5kxVIJ4ESgj+GdoGKRdLJVSDrAH1E5nKvCvC0iQ5jP tBdOSPubINvddgyKEgk+TSDmago0f/k00q2fwUKvGZMU7xE8vLPBTUjZuZbwGS04uYIC toYw== 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; bh=kWYzYUl3W7xsDxnKtqbz6nH4lpvFjQWiEDurDeTsFGk=; b=sz0woWSfjV+/ISTeTCxr1fN1tEyhKAZjT59B+aaQOGkbedRJjm4s5RNTY4nUNnjvZO bausyUGNATsAsWdoDhqZ+myN3gO7LULsiV0cbTourZLZQpe773dFw6Ele2LAIkv5qr9W rSQ3+nlkBfppIO+O5GgQdwkJrxAtaxJV7f2FA5GHWFiZT0g7ueJ63RoXZDRfOFPYjpfh bGDE1RZfmaETqdmvG1nz0PBWYa+AibwSQ6yAKs2wciNq3uN100pwHVXh5cy+rkbX1OBD qJ5I7cqS8M7RiA23VdNCqWvuw9mJWCEmdtGb97fIWCLW0l+J6WggtSrlCtC4UiVoHQOt hOMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j70-20020a638049000000b00507681e127dsi6514539pgd.700.2023.03.13.06.32.42; Mon, 13 Mar 2023 06:32:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230419AbjCMNV0 (ORCPT + 99 others); Mon, 13 Mar 2023 09:21:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229996AbjCMNVP (ORCPT ); Mon, 13 Mar 2023 09:21:15 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A3C1360B7; Mon, 13 Mar 2023 06:21:13 -0700 (PDT) Received: from kwepemm600013.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4PZxzq5GCxz17KfZ; Mon, 13 Mar 2023 21:18:15 +0800 (CST) Received: from huawei.com (10.175.127.227) by kwepemm600013.china.huawei.com (7.193.23.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 13 Mar 2023 21:21:09 +0800 From: Zhihao Cheng To: , , , CC: , , , Subject: [PATCH v2 1/5] ext4: Fix reusing stale buffer heads from last failed mounting Date: Mon, 13 Mar 2023 21:20:17 +0800 Message-ID: <20230313132021.672134-2-chengzhihao1@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313132021.672134-1-chengzhihao1@huawei.com> References: <20230313132021.672134-1-chengzhihao1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600013.china.huawei.com (7.193.23.68) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760259606322937179?= X-GMAIL-MSGID: =?utf-8?q?1760259606322937179?= Following process makes ext4 load stale buffer heads from last failed mounting in a new mounting operation: mount_bdev ext4_fill_super | ext4_load_and_init_journal | ext4_load_journal | jbd2_journal_load | load_superblock | journal_get_superblock | set_buffer_verified(bh) // buffer head is verified | jbd2_journal_recover // failed caused by EIO | goto failed_mount3a // skip 'sb->s_root' initialization deactivate_locked_super kill_block_super generic_shutdown_super if (sb->s_root) // false, skip ext4_put_super->invalidate_bdev-> // invalidate_mapping_pages->mapping_evict_folio-> // filemap_release_folio->try_to_free_buffers, which // cannot drop buffer head. blkdev_put blkdev_put_whole if (atomic_dec_and_test(&bdev->bd_openers)) // false, systemd-udev happens to open the device. Then // blkdev_flush_mapping->kill_bdev->truncate_inode_pages-> // truncate_inode_folio->truncate_cleanup_folio-> // folio_invalidate->block_invalidate_folio-> // filemap_release_folio->try_to_free_buffers will be skipped, // dropping buffer head is missed again. Second mount: ext4_fill_super ext4_load_and_init_journal ext4_load_journal ext4_get_journal jbd2_journal_init_inode journal_init_common bh = getblk_unmovable bh = __find_get_block // Found stale bh in last failed mounting journal->j_sb_buffer = bh jbd2_journal_load load_superblock journal_get_superblock if (buffer_verified(bh)) // true, skip journal->j_format_version = 2, value is 0 jbd2_journal_recover do_one_pass next_log_block += count_tags(journal, bh) // According to journal_tag_bytes(), 'tag_bytes' calculating is // affected by jbd2_has_feature_csum3(), jbd2_has_feature_csum3() // returns false because 'j->j_format_version >= 2' is not true, // then we get wrong next_log_block. The do_one_pass may exit // early whenoccuring non JBD2_MAGIC_NUMBER in 'next_log_block'. The filesystem is corrupted here, journal is partially replayed, and new journal sequence number actually is already used by last mounting. The invalidate_bdev() can drop all buffer heads even racing with bare reading block device(eg. systemd-udev), so we can fix it by invalidating bdev in error handling path in __ext4_fill_super(). Fetch a reproducer in [Link]. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217171 Fixes: 25ed6e8a54df ("jbd2: enable journal clients to enable v2 checksumming") Cc: stable@vger.kernel.org # v3.5 Signed-off-by: Zhihao Cheng --- fs/ext4/super.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 88f7b8a88c76..7e990637bc48 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1126,6 +1126,12 @@ static void ext4_blkdev_remove(struct ext4_sb_info *sbi) struct block_device *bdev; bdev = sbi->s_journal_bdev; if (bdev) { + /* + * Invalidate the journal device's buffers. We don't want them + * floating about in memory - the physical journal device may + * hotswapped, and it breaks the `ro-after' testing code. + */ + invalidate_bdev(bdev); ext4_blkdev_put(bdev); sbi->s_journal_bdev = NULL; } @@ -1271,14 +1277,8 @@ static void ext4_put_super(struct super_block *sb) sync_blockdev(sb->s_bdev); invalidate_bdev(sb->s_bdev); - if (sbi->s_journal_bdev && sbi->s_journal_bdev != sb->s_bdev) { - /* - * Invalidate the journal device's buffers. We don't want them - * floating about in memory - the physical journal device may - * hotswapped, and it breaks the `ro-after' testing code. - */ + if (sbi->s_journal_bdev) { sync_blockdev(sbi->s_journal_bdev); - invalidate_bdev(sbi->s_journal_bdev); ext4_blkdev_remove(sbi); } @@ -5610,6 +5610,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) brelse(sbi->s_sbh); ext4_blkdev_remove(sbi); out_fail: + invalidate_bdev(sb->s_bdev); sb->s_fs_info = NULL; return err ? err : ret; } From patchwork Mon Mar 13 13:20:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhihao Cheng X-Patchwork-Id: 68845 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1192222wrd; Mon, 13 Mar 2023 06:41:01 -0700 (PDT) X-Google-Smtp-Source: AK7set/pf+xgjbWjGTJw8SCVpOQrt4neAgCTK6GkX0xQVz2vDOSJbtzvdpl/mgAub4mZBBXS/fqw X-Received: by 2002:a62:8402:0:b0:623:1396:4611 with SMTP id k2-20020a628402000000b0062313964611mr6436617pfd.9.1678714861228; Mon, 13 Mar 2023 06:41:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678714861; cv=none; d=google.com; s=arc-20160816; b=IzVSEXQmNMKIOTF5bnWMl7u/hl9wErkpVEKhx4tzLT3oNZOackL3MLVvhBlnHW6QuR lEhsv3EkB1U/k/pRwalTKI0jebwqViL8KEPp3jjvxmEI1J2orZgsFPw0olh8GfF5u9MV twQCefnGNSHLcrYP2kYevwYxQ2tShDbyVQr/GPc4xN9ymDdme3WWetedr/qW/vFxoJ/t Wu5i5E4bAoZxds2BQiePhU8Or/5YgoTrhDc9qs4Y/Ao//et2D+sNWu4lmGW3eXG9DIiG oXGa/RBj4rIxYQLp6AFERV6+Qsl77tyvbkEtiyzOMrI6Cpjnm4niLg1x8OTknUMFAgS/ SRFA== 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; bh=r9vN5KF/ve1+PIvg2+TaGwq3HMbvIOQ1Vf6hYMEzVq0=; b=U0drbts2cXW+gJUQDgL7ORYzm2jTbqrXgYSGMNajMEJN5IE3V50dsWh1789sEts/tS M5Ws9K++7WDlY9ExL3yuVe++0NpsoJIaBg45Xk+D3nKUnjt4RJp/UiIRDgSi+cD55wMz mI87zAJWT2GHnfS9nS0Xs6gzoz2vUwigIUxpDrXdt56jBmfVOwXSP3KUysHDvt5Q0N11 Ws2vPeVDC3faptp7wWN2XSAs7Iv2MqxrZ0Z/qC28YFvC+YSdnbyYJqiLGtqWfDmIprSZ qnGray1ulEdI9tdAGloz+1gbAylt166ejvQ+3XxjqChSxYOr9KDz39y+Sk5CiFi0gfbj y/GQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z15-20020aa791cf000000b005a9c2c4657fsi6452032pfa.191.2023.03.13.06.40.46; Mon, 13 Mar 2023 06:41:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230410AbjCMNVW (ORCPT + 99 others); Mon, 13 Mar 2023 09:21:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229910AbjCMNVP (ORCPT ); Mon, 13 Mar 2023 09:21:15 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3288734008; Mon, 13 Mar 2023 06:21:13 -0700 (PDT) Received: from kwepemm600013.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4PZxzr3M6dz17KjY; Mon, 13 Mar 2023 21:18:16 +0800 (CST) Received: from huawei.com (10.175.127.227) by kwepemm600013.china.huawei.com (7.193.23.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 13 Mar 2023 21:21:10 +0800 From: Zhihao Cheng To: , , , CC: , , , Subject: [PATCH v2 2/5] jbd2: remove unused feature macros Date: Mon, 13 Mar 2023 21:20:18 +0800 Message-ID: <20230313132021.672134-3-chengzhihao1@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313132021.672134-1-chengzhihao1@huawei.com> References: <20230313132021.672134-1-chengzhihao1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600013.china.huawei.com (7.193.23.68) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760260114501991235?= X-GMAIL-MSGID: =?utf-8?q?1760260114501991235?= From: Zhang Yi JBD2_HAS_[IN|RO_]COMPAT_FEATURE macros are no longer used, just remove them. Signed-off-by: Zhang Yi Signed-off-by: Zhihao Cheng --- include/linux/jbd2.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 5962072a4b19..ad7bb6861143 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -274,17 +274,6 @@ typedef struct journal_superblock_s /* 0x0400 */ } journal_superblock_t; -/* Use the jbd2_{has,set,clear}_feature_* helpers; these will be removed */ -#define JBD2_HAS_COMPAT_FEATURE(j,mask) \ - ((j)->j_format_version >= 2 && \ - ((j)->j_superblock->s_feature_compat & cpu_to_be32((mask)))) -#define JBD2_HAS_RO_COMPAT_FEATURE(j,mask) \ - ((j)->j_format_version >= 2 && \ - ((j)->j_superblock->s_feature_ro_compat & cpu_to_be32((mask)))) -#define JBD2_HAS_INCOMPAT_FEATURE(j,mask) \ - ((j)->j_format_version >= 2 && \ - ((j)->j_superblock->s_feature_incompat & cpu_to_be32((mask)))) - #define JBD2_FEATURE_COMPAT_CHECKSUM 0x00000001 #define JBD2_FEATURE_INCOMPAT_REVOKE 0x00000001 From patchwork Mon Mar 13 13:20:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhihao Cheng X-Patchwork-Id: 68840 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1190529wrd; Mon, 13 Mar 2023 06:37:44 -0700 (PDT) X-Google-Smtp-Source: AK7set8nECiWHA0bhuyUCf0BVbtAxmSLMP3vmpCtSyJI37OTJuTgs2F5HCDM15+ih8yjfRjonyxA X-Received: by 2002:a17:90b:4d8a:b0:233:d181:5b75 with SMTP id oj10-20020a17090b4d8a00b00233d1815b75mr34812447pjb.31.1678714663849; Mon, 13 Mar 2023 06:37:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678714663; cv=none; d=google.com; s=arc-20160816; b=0rUgKielXkBXCtvcMxS+KP9iz2hzPF+rh5Ydzeilujq17hqg6Wkx1qYHyhcohatxAm JAJqCVfYZcVUldiyJDUBg9/Vjzw8MgwAwB467CHDKTl7eVcGxCtOwp1pWFHENr8iNprQ 2BOrKdLs0QcAt0be8DNig6y88Nuzd6GF1FOh2HoiY87wY4tcy08Pr8LtuxTGyxYtr2yQ TTx6oM9zBbw8h13MOL9qtnCrVyQcAHORdD3kBbqrFJbHlTmZjC1Va/+g/9ElMN6KdDT9 8Dms4JKoxW+32IVZ0x5o4xYVLAV14rNudhT4HMdC4lBmlDBRX8Gi7NyIfxL27yVj2h5c ic5A== 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; bh=Td0nMLfuepwMC8pPH1SytHoONl4ekVV4sCgwly4wkgM=; b=J546yB02rriPfZyfMUMocKLQS/NC5n6QpZSU4eRGp7/M1DtWwzzZQUHhg0bZx0W+eW e4N+2KaYjV/0IR4Duodf+a1jlbLj7GKmkEMDYkdRHimEq8SKOVRugLvky0bFErWyYerB FvquTjQzdpg8cPRRDfjaRt2V4pcitaqke3lrJlyk+K5rq8fn+mw6YFtgm+PLLNd0hG/S yp+WnK4i9CAfL9bth7yp8RT9yNqckUmnDbiKlCFNwkoHuI0rYipabPaipqxBB3Ti6Z0Z OpozPuiTvsJeIjGbI91ZPjrJEsx4eeQVHMSfECIgmcJKpo0DUjXIMUUddcTOqKBZkO11 6wbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pg11-20020a17090b1e0b00b002375a3e4b10si6999318pjb.47.2023.03.13.06.37.30; Mon, 13 Mar 2023 06:37:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230356AbjCMNVb (ORCPT + 99 others); Mon, 13 Mar 2023 09:21:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbjCMNVP (ORCPT ); Mon, 13 Mar 2023 09:21:15 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05B1C303F6; Mon, 13 Mar 2023 06:21:14 -0700 (PDT) Received: from kwepemm600013.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4PZy2D0l9FzrScw; Mon, 13 Mar 2023 21:20:20 +0800 (CST) Received: from huawei.com (10.175.127.227) by kwepemm600013.china.huawei.com (7.193.23.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 13 Mar 2023 21:21:11 +0800 From: Zhihao Cheng To: , , , CC: , , , Subject: [PATCH v2 3/5] jbd2: switch to check format version in superblock directly Date: Mon, 13 Mar 2023 21:20:19 +0800 Message-ID: <20230313132021.672134-4-chengzhihao1@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313132021.672134-1-chengzhihao1@huawei.com> References: <20230313132021.672134-1-chengzhihao1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600013.china.huawei.com (7.193.23.68) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760259907355788147?= X-GMAIL-MSGID: =?utf-8?q?1760259907355788147?= From: Zhang Yi We should only check and set extented features if journal format version is 2, and now we check the in memory copy of the superblock 'journal->j_format_version', which relys on the parameter initialization sequence, switch to use the h_blocktype in superblock cloud be more clear. Signed-off-by: Zhang Yi Signed-off-by: Zhihao Cheng --- fs/jbd2/journal.c | 16 +++++++--------- include/linux/jbd2.h | 17 ++++++++++++++--- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index e80c781731f8..b991d5c21d16 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -2059,10 +2059,12 @@ int jbd2_journal_load(journal_t *journal) return err; sb = journal->j_superblock; - /* If this is a V2 superblock, then we have to check the - * features flags on it. */ - if (journal->j_format_version >= 2) { + /* + * If this is a V2 superblock, then we have to check the + * features flags on it. + */ + if (jbd2_format_support_feature(journal)) { if ((sb->s_feature_ro_compat & ~cpu_to_be32(JBD2_KNOWN_ROCOMPAT_FEATURES)) || (sb->s_feature_incompat & @@ -2224,7 +2226,7 @@ int jbd2_journal_check_used_features(journal_t *journal, unsigned long compat, if (journal->j_format_version == 0 && journal_get_superblock(journal) != 0) return 0; - if (journal->j_format_version == 1) + if (!jbd2_format_support_feature(journal)) return 0; sb = journal->j_superblock; @@ -2254,11 +2256,7 @@ int jbd2_journal_check_available_features(journal_t *journal, unsigned long comp if (!compat && !ro && !incompat) return 1; - /* We can support any known requested features iff the - * superblock is in version 2. Otherwise we fail to support any - * extended sb features. */ - - if (journal->j_format_version != 2) + if (!jbd2_format_support_feature(journal)) return 0; if ((compat & JBD2_KNOWN_COMPAT_FEATURES) == compat && diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index ad7bb6861143..7095c0f17ad0 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -1305,11 +1305,22 @@ struct journal_s rwsem_release(&j->j_trans_commit_map, _THIS_IP_); \ } while (0) +/* + * We can support any known requested features iff the + * superblock is not in version 1. Otherwise we fail to support any + * extended sb features. + */ +static inline bool jbd2_format_support_feature(journal_t *j) +{ + return j->j_superblock->s_header.h_blocktype != + cpu_to_be32(JBD2_SUPERBLOCK_V1); +} + /* journal feature predicate functions */ #define JBD2_FEATURE_COMPAT_FUNCS(name, flagname) \ static inline bool jbd2_has_feature_##name(journal_t *j) \ { \ - return ((j)->j_format_version >= 2 && \ + return (jbd2_format_support_feature(j) && \ ((j)->j_superblock->s_feature_compat & \ cpu_to_be32(JBD2_FEATURE_COMPAT_##flagname)) != 0); \ } \ @@ -1327,7 +1338,7 @@ static inline void jbd2_clear_feature_##name(journal_t *j) \ #define JBD2_FEATURE_RO_COMPAT_FUNCS(name, flagname) \ static inline bool jbd2_has_feature_##name(journal_t *j) \ { \ - return ((j)->j_format_version >= 2 && \ + return (jbd2_format_support_feature(j) && \ ((j)->j_superblock->s_feature_ro_compat & \ cpu_to_be32(JBD2_FEATURE_RO_COMPAT_##flagname)) != 0); \ } \ @@ -1345,7 +1356,7 @@ static inline void jbd2_clear_feature_##name(journal_t *j) \ #define JBD2_FEATURE_INCOMPAT_FUNCS(name, flagname) \ static inline bool jbd2_has_feature_##name(journal_t *j) \ { \ - return ((j)->j_format_version >= 2 && \ + return (jbd2_format_support_feature(j) && \ ((j)->j_superblock->s_feature_incompat & \ cpu_to_be32(JBD2_FEATURE_INCOMPAT_##flagname)) != 0); \ } \ From patchwork Mon Mar 13 13:20:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhihao Cheng X-Patchwork-Id: 68846 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1193955wrd; Mon, 13 Mar 2023 06:44:27 -0700 (PDT) X-Google-Smtp-Source: AK7set/k1It8ZjKHN8IhCAjcR0eYARZrujRiPELf0YsKvIR6nHsDJ9079CBJamSTIWhuM5NER+0U X-Received: by 2002:a17:902:d4cd:b0:19a:70f9:affb with SMTP id o13-20020a170902d4cd00b0019a70f9affbmr41209874plg.2.1678715066866; Mon, 13 Mar 2023 06:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678715066; cv=none; d=google.com; s=arc-20160816; b=ntRPbtANQjMsHU8WVOyfVucOaDGRG9U8Zb57Bqu4m2vJgGnSyFVl0JJMP+NUmFup9L EDXC49UKhQmxjAeFLItegJfkdC0a62tlV7uPha9jS4s5T2Mslhpr6OVShsxzMJ7nhJ5H VGAPU6v9w1LuBGye0UwYpZb4SakOhMdTv8aG1a2oESmxjzCJdkjuze0er52TDWWkwMs5 kuniVPuOgBWiBJyxgNb2F2umRmYkAOjM44rFqYibMTgmbumBMN8XgU36TyWN/YBEjzkH ug2T2yEPTpQ+yywsxyDajqqeUZg6pTAqG29PjWUXDgFNa7MAfDXuOYYtSJPR+5vWfOkO PxWw== 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; bh=FCQ6Q0qlpN7ukPikR7RENlF2IHnCJpvzh7lDRvw8Z/8=; b=0b4wvc8JBYzYOZYgpi43BDJN+jR6RuLua3a4goJBuXvkKOaXdz/yfwrxRgUaUQ5j/r VK4HTxV7jdXih0l/oTOEVMG11IopPcEaYBUQyw4xIUMzQV33jnYzhaJKN2IPlZD6nUYF LVA0Cs6QbFGCU8TUPWsH21+BNcf8s8MObIhldS1P39fC5bM1c2mjkdlJ915RJHU1L5/g OijuS2DdlSpqJbkDqHySRN10NTWx8W6g0vP4ko+KiXiPaggABiynWLyQvzWNjlo7Jio+ L+i9mjk0i7VxI6MJw/CxU1ClEt8e1DSk6p7cYJx560RIaKP+AXcfwLYlD3PKrn1rYsxH O5mw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l65-20020a639144000000b004e018302ac3si6626353pge.612.2023.03.13.06.44.14; Mon, 13 Mar 2023 06:44:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230451AbjCMNVg (ORCPT + 99 others); Mon, 13 Mar 2023 09:21:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjCMNVP (ORCPT ); Mon, 13 Mar 2023 09:21:15 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41CA04AFEB; Mon, 13 Mar 2023 06:21:14 -0700 (PDT) Received: from kwepemm600013.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4PZxzs6ZtHz17KJ4; Mon, 13 Mar 2023 21:18:17 +0800 (CST) Received: from huawei.com (10.175.127.227) by kwepemm600013.china.huawei.com (7.193.23.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 13 Mar 2023 21:21:11 +0800 From: Zhihao Cheng To: , , , CC: , , , Subject: [PATCH v2 4/5] jbd2: factor out journal initialization from journal_get_superblock() Date: Mon, 13 Mar 2023 21:20:20 +0800 Message-ID: <20230313132021.672134-5-chengzhihao1@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313132021.672134-1-chengzhihao1@huawei.com> References: <20230313132021.672134-1-chengzhihao1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600013.china.huawei.com (7.193.23.68) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760260329771152775?= X-GMAIL-MSGID: =?utf-8?q?1760260329771152775?= From: Zhang Yi Current journal_get_superblock() couple journal superblock checking and partial journal initialization, factor out initialization part from it to make things clear. Signed-off-by: Zhang Yi Signed-off-by: Zhihao Cheng --- fs/jbd2/journal.c | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index b991d5c21d16..f99c46d880b2 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1922,21 +1922,13 @@ static int journal_get_superblock(journal_t *journal) goto out; } - switch(be32_to_cpu(sb->s_header.h_blocktype)) { - case JBD2_SUPERBLOCK_V1: - journal->j_format_version = 1; - break; - case JBD2_SUPERBLOCK_V2: - journal->j_format_version = 2; - break; - default: + if (be32_to_cpu(sb->s_header.h_blocktype) != JBD2_SUPERBLOCK_V1 && + be32_to_cpu(sb->s_header.h_blocktype) != JBD2_SUPERBLOCK_V2) { printk(KERN_WARNING "JBD2: unrecognised superblock format ID\n"); goto out; } - if (be32_to_cpu(sb->s_maxlen) < journal->j_total_len) - journal->j_total_len = be32_to_cpu(sb->s_maxlen); - else if (be32_to_cpu(sb->s_maxlen) > journal->j_total_len) { + if (be32_to_cpu(sb->s_maxlen) > journal->j_total_len) { printk(KERN_WARNING "JBD2: journal file too short\n"); goto out; } @@ -1979,25 +1971,14 @@ static int journal_get_superblock(journal_t *journal) journal->j_chksum_driver = NULL; goto out; } - } - - if (jbd2_journal_has_csum_v2or3(journal)) { /* Check superblock checksum */ if (sb->s_checksum != jbd2_superblock_csum(journal, sb)) { printk(KERN_ERR "JBD2: journal checksum error\n"); err = -EFSBADCRC; goto out; } - - /* Precompute checksum seed for all metadata */ - journal->j_csum_seed = jbd2_chksum(journal, ~0, sb->s_uuid, - sizeof(sb->s_uuid)); } - - journal->j_revoke_records_per_block = - journal_revoke_records_per_block(journal); set_buffer_verified(bh); - return 0; out: @@ -2022,12 +2003,30 @@ static int load_superblock(journal_t *journal) sb = journal->j_superblock; + switch (be32_to_cpu(sb->s_header.h_blocktype)) { + case JBD2_SUPERBLOCK_V1: + journal->j_format_version = 1; + break; + case JBD2_SUPERBLOCK_V2: + journal->j_format_version = 2; + break; + } + journal->j_tail_sequence = be32_to_cpu(sb->s_sequence); journal->j_tail = be32_to_cpu(sb->s_start); journal->j_first = be32_to_cpu(sb->s_first); journal->j_errno = be32_to_cpu(sb->s_errno); journal->j_last = be32_to_cpu(sb->s_maxlen); + if (be32_to_cpu(sb->s_maxlen) < journal->j_total_len) + journal->j_total_len = be32_to_cpu(sb->s_maxlen); + /* Precompute checksum seed for all metadata */ + if (jbd2_journal_has_csum_v2or3(journal)) + journal->j_csum_seed = jbd2_chksum(journal, ~0, sb->s_uuid, + sizeof(sb->s_uuid)); + journal->j_revoke_records_per_block = + journal_revoke_records_per_block(journal); + if (jbd2_has_feature_fast_commit(journal)) { journal->j_fc_last = be32_to_cpu(sb->s_maxlen); num_fc_blocks = jbd2_journal_get_num_fc_blks(sb); @@ -2223,8 +2222,7 @@ int jbd2_journal_check_used_features(journal_t *journal, unsigned long compat, if (!compat && !ro && !incompat) return 1; /* Load journal superblock if it is not loaded yet. */ - if (journal->j_format_version == 0 && - journal_get_superblock(journal) != 0) + if (journal_get_superblock(journal)) return 0; if (!jbd2_format_support_feature(journal)) return 0; From patchwork Mon Mar 13 13:20:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhihao Cheng X-Patchwork-Id: 68842 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1191197wrd; Mon, 13 Mar 2023 06:38:56 -0700 (PDT) X-Google-Smtp-Source: AK7set+XLLHKMEkSRtZaEeRlRRmXQJOaTVZ5sHRoADF1tezkOaEXAJiJw63bbVN7hWrIiCEPvFbr X-Received: by 2002:a17:902:e886:b0:199:4a00:9788 with SMTP id w6-20020a170902e88600b001994a009788mr43719212plg.19.1678714736408; Mon, 13 Mar 2023 06:38:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678714736; cv=none; d=google.com; s=arc-20160816; b=d5/6R/veRgwCDqDHtKo0Qkxcq54kQucVPQQa5tHYqBVXW++h8CbVd5oGCieuMRuH5C WvAW5InwA7drNuGUT0l1AEqjRTXaHGsd3Rt0GrRD9WSQluh0XvmnjJvVT36bASmyHx8m ReevWxOzUATKZEgpqg0+/g/jsl/+NaGAK+4Ik/I2AVyCdsM+tbSnmbuLyvWXiiAiAN2g jffSqIqniRFmWA75naYFp/6KIe0Y9cYPx1iDaoStH99RQyQTHGZhXqPPbr2kdAKUPSwC 8uZW8xQY8fWdbK/Q3jvVj+05yOcb8hGbPMU5AcSZPGLdJbo4w5bbHGhbR9A4Y49CQO2z Ce6Q== 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; bh=XvJRtSQxJ7IdEcIipCoywRuhSisNrVsCbAVR5Hiy8KY=; b=Do6G8TbZbMoLr6CjNa+AJH0N9E6ZaFRe1pKSKIsyFit1a6CnZx6AQu9utoFaU3VzNM GHP6FXk44HGc3UcH5jiwru3FkwK/+dRQ7eSmAvkm3egiS3HLixIzVYye3DFnuXgzX4xx wrqFKmQC6N+O/h3WbqqPunCU5zIdsfLTCse94lOyTVuBVI+ohY0+irZwi25PaNPKFIDJ U0ZYwP1Jy6wGFYLABHu/k7bFZ4O3KhuqR7OwDS4Wh8IPHO+gKCupzmnw6G4ILBmX/6HM ikhxHoibP/vShcbgovjUn/TWagWXYubOyIFOrF1No97tStA9jJeu/3YV0gTMcU3iMTEb NdRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v6-20020a1709029a0600b0019ccdd9d745si6569690plp.17.2023.03.13.06.38.41; Mon, 13 Mar 2023 06:38:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230443AbjCMNVd (ORCPT + 99 others); Mon, 13 Mar 2023 09:21:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230114AbjCMNVQ (ORCPT ); Mon, 13 Mar 2023 09:21:16 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87093305F0; Mon, 13 Mar 2023 06:21:15 -0700 (PDT) Received: from kwepemm600013.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4PZy305DJDzKmR5; Mon, 13 Mar 2023 21:21:00 +0800 (CST) Received: from huawei.com (10.175.127.227) by kwepemm600013.china.huawei.com (7.193.23.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 13 Mar 2023 21:21:12 +0800 From: Zhihao Cheng To: , , , CC: , , , Subject: [PATCH v2 5/5] jbd2: remove j_format_version Date: Mon, 13 Mar 2023 21:20:21 +0800 Message-ID: <20230313132021.672134-6-chengzhihao1@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313132021.672134-1-chengzhihao1@huawei.com> References: <20230313132021.672134-1-chengzhihao1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600013.china.huawei.com (7.193.23.68) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760259983275054440?= X-GMAIL-MSGID: =?utf-8?q?1760259983275054440?= From: Zhang Yi journal->j_format_version is no longer used, remove it. Signed-off-by: Zhang Yi Signed-off-by: Zhihao Cheng --- fs/jbd2/journal.c | 9 --------- include/linux/jbd2.h | 5 ----- 2 files changed, 14 deletions(-) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index f99c46d880b2..c19cdd402a5f 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -2003,15 +2003,6 @@ static int load_superblock(journal_t *journal) sb = journal->j_superblock; - switch (be32_to_cpu(sb->s_header.h_blocktype)) { - case JBD2_SUPERBLOCK_V1: - journal->j_format_version = 1; - break; - case JBD2_SUPERBLOCK_V2: - journal->j_format_version = 2; - break; - } - journal->j_tail_sequence = be32_to_cpu(sb->s_sequence); journal->j_tail = be32_to_cpu(sb->s_start); journal->j_first = be32_to_cpu(sb->s_first); diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 7095c0f17ad0..b7c79f68f7ca 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -792,11 +792,6 @@ struct journal_s */ journal_superblock_t *j_superblock; - /** - * @j_format_version: Version of the superblock format. - */ - int j_format_version; - /** * @j_state_lock: Protect the various scalars in the journal. */