Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

btrfs: check-integrity: remove CONFIG_BTRFS_FS_CHECK_INTEGRITY option

Since all check-integrity entry points have been removed, let's also
remove the config and all related code relying on that.

And since we have removed the mount option for check-integrity, we also
need to re-number all the BTRFS_MOUNT_* enums.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Qu Wenruo and committed by
David Sterba
732fab95 fb2a836d

+11 -121
-21
fs/btrfs/Kconfig
··· 48 48 49 49 If you don't know what Access Control Lists are, say N 50 50 51 - config BTRFS_FS_CHECK_INTEGRITY 52 - bool "Btrfs with integrity check tool compiled in (DEPRECATED)" 53 - depends on BTRFS_FS 54 - help 55 - This feature has been deprecated and will be removed in 6.7. 56 - 57 - Adds code that examines all block write requests (including 58 - writes of the super block). The goal is to verify that the 59 - state of the filesystem on disk is always consistent, i.e., 60 - after a power-loss or kernel panic event the filesystem is 61 - in a consistent state. 62 - 63 - If the integrity check tool is included and activated in 64 - the mount options, plenty of kernel memory is used, and 65 - plenty of additional CPU cycles are spent. Enabling this 66 - functionality is not intended for normal use. 67 - 68 - In most cases, unless you are a btrfs developer who needs 69 - to verify the integrity of (super)-block write requests 70 - during the run of a regression test, say N 71 - 72 51 config BTRFS_FS_RUN_SANITY_TESTS 73 52 bool "Btrfs will run sanity tests upon loading" 74 53 depends on BTRFS_FS
-28
fs/btrfs/disk-io.c
··· 2736 2736 spin_lock_init(&fs_info->ordered_root_lock); 2737 2737 2738 2738 btrfs_init_scrub(fs_info); 2739 - #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY 2740 - fs_info->check_integrity_print_mask = 0; 2741 - #endif 2742 2739 btrfs_init_balance(fs_info); 2743 2740 btrfs_init_async_reclaim_work(fs_info); 2744 2741 ··· 3901 3904 3902 3905 device->last_flush_error = BLK_STS_OK; 3903 3906 3904 - #ifndef CONFIG_BTRFS_FS_CHECK_INTEGRITY 3905 - /* 3906 - * When a disk has write caching disabled, we skip submission of a bio 3907 - * with flush and sync requests before writing the superblock, since 3908 - * it's not needed. However when the integrity checker is enabled, this 3909 - * results in reports that there are metadata blocks referred by a 3910 - * superblock that were not properly flushed. So don't skip the bio 3911 - * submission only when the integrity checker is enabled for the sake 3912 - * of simplicity, since this is a debug tool and not meant for use in 3913 - * non-debug builds. 3914 - */ 3915 - if (!bdev_write_cache(device->bdev)) 3916 - return; 3917 - #endif 3918 - 3919 3907 bio_init(bio, device->bdev, NULL, 0, 3920 3908 REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH); 3921 3909 bio->bi_end_io = btrfs_end_empty_barrier; ··· 4404 4422 WARN(1, KERN_CRIT "btrfs transid mismatch buffer %llu, found %llu running %llu\n", 4405 4423 buf->start, transid, fs_info->generation); 4406 4424 set_extent_buffer_dirty(buf); 4407 - #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY 4408 - /* 4409 - * btrfs_check_leaf() won't check item data if we don't have WRITTEN 4410 - * set, so this will only validate the basic structure of the items. 4411 - */ 4412 - if (btrfs_header_level(buf) == 0 && btrfs_check_leaf(buf)) { 4413 - btrfs_print_leaf(buf); 4414 - ASSERT(0); 4415 - } 4416 - #endif 4417 4425 } 4418 4426 4419 4427 static void __btrfs_btree_balance_dirty(struct btrfs_fs_info *fs_info,
+11 -16
fs/btrfs/fs.h
··· 171 171 BTRFS_MOUNT_AUTO_DEFRAG = (1UL << 16), 172 172 BTRFS_MOUNT_USEBACKUPROOT = (1UL << 17), 173 173 BTRFS_MOUNT_SKIP_BALANCE = (1UL << 18), 174 - BTRFS_MOUNT_CHECK_INTEGRITY = (1UL << 19), 175 - BTRFS_MOUNT_CHECK_INTEGRITY_DATA = (1UL << 20), 176 - BTRFS_MOUNT_PANIC_ON_FATAL_ERROR = (1UL << 21), 177 - BTRFS_MOUNT_RESCAN_UUID_TREE = (1UL << 22), 178 - BTRFS_MOUNT_FRAGMENT_DATA = (1UL << 23), 179 - BTRFS_MOUNT_FRAGMENT_METADATA = (1UL << 24), 180 - BTRFS_MOUNT_FREE_SPACE_TREE = (1UL << 25), 181 - BTRFS_MOUNT_NOLOGREPLAY = (1UL << 26), 182 - BTRFS_MOUNT_REF_VERIFY = (1UL << 27), 183 - BTRFS_MOUNT_DISCARD_ASYNC = (1UL << 28), 184 - BTRFS_MOUNT_IGNOREBADROOTS = (1UL << 29), 185 - BTRFS_MOUNT_IGNOREDATACSUMS = (1UL << 30), 186 - BTRFS_MOUNT_NODISCARD = (1UL << 31), 174 + BTRFS_MOUNT_PANIC_ON_FATAL_ERROR = (1UL << 19), 175 + BTRFS_MOUNT_RESCAN_UUID_TREE = (1UL << 20), 176 + BTRFS_MOUNT_FRAGMENT_DATA = (1UL << 21), 177 + BTRFS_MOUNT_FRAGMENT_METADATA = (1UL << 22), 178 + BTRFS_MOUNT_FREE_SPACE_TREE = (1UL << 23), 179 + BTRFS_MOUNT_NOLOGREPLAY = (1UL << 24), 180 + BTRFS_MOUNT_REF_VERIFY = (1UL << 25), 181 + BTRFS_MOUNT_DISCARD_ASYNC = (1UL << 26), 182 + BTRFS_MOUNT_IGNOREBADROOTS = (1UL << 27), 183 + BTRFS_MOUNT_IGNOREDATACSUMS = (1UL << 28), 184 + BTRFS_MOUNT_NODISCARD = (1UL << 29), 187 185 }; 188 186 189 187 /* ··· 643 645 644 646 struct btrfs_discard_ctl discard_ctl; 645 647 646 - #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY 647 - u32 check_integrity_print_mask; 648 - #endif 649 648 /* Is qgroup tracking in a consistent state? */ 650 649 u64 qgroup_flags; 651 650
-56
fs/btrfs/super.c
··· 130 130 Opt_inode_cache, Opt_noinode_cache, 131 131 132 132 /* Debugging options */ 133 - Opt_check_integrity, 134 - Opt_check_integrity_including_extent_data, 135 - Opt_check_integrity_print_mask, 136 133 Opt_enospc_debug, Opt_noenospc_debug, 137 134 #ifdef CONFIG_BTRFS_DEBUG 138 135 Opt_fragment_data, Opt_fragment_metadata, Opt_fragment_all, ··· 198 201 {Opt_recovery, "recovery"}, 199 202 200 203 /* Debugging options */ 201 - {Opt_check_integrity, "check_int"}, 202 - {Opt_check_integrity_including_extent_data, "check_int_data"}, 203 - {Opt_check_integrity_print_mask, "check_int_print_mask=%u"}, 204 204 {Opt_enospc_debug, "enospc_debug"}, 205 205 {Opt_noenospc_debug, "noenospc_debug"}, 206 206 #ifdef CONFIG_BTRFS_DEBUG ··· 702 708 case Opt_skip_balance: 703 709 btrfs_set_opt(info->mount_opt, SKIP_BALANCE); 704 710 break; 705 - #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY 706 - case Opt_check_integrity_including_extent_data: 707 - btrfs_warn(info, 708 - "integrity checker is deprecated and will be removed in 6.7"); 709 - btrfs_info(info, 710 - "enabling check integrity including extent data"); 711 - btrfs_set_opt(info->mount_opt, CHECK_INTEGRITY_DATA); 712 - btrfs_set_opt(info->mount_opt, CHECK_INTEGRITY); 713 - break; 714 - case Opt_check_integrity: 715 - btrfs_warn(info, 716 - "integrity checker is deprecated and will be removed in 6.7"); 717 - btrfs_info(info, "enabling check integrity"); 718 - btrfs_set_opt(info->mount_opt, CHECK_INTEGRITY); 719 - break; 720 - case Opt_check_integrity_print_mask: 721 - ret = match_int(&args[0], &intarg); 722 - if (ret) { 723 - btrfs_err(info, 724 - "unrecognized check_integrity_print_mask value %s", 725 - args[0].from); 726 - goto out; 727 - } 728 - info->check_integrity_print_mask = intarg; 729 - btrfs_warn(info, 730 - "integrity checker is deprecated and will be removed in 6.7"); 731 - btrfs_info(info, "check_integrity_print_mask 0x%x", 732 - info->check_integrity_print_mask); 733 - break; 734 - #else 735 - case Opt_check_integrity_including_extent_data: 736 - case Opt_check_integrity: 737 - case Opt_check_integrity_print_mask: 738 - btrfs_err(info, 739 - "support for check_integrity* not compiled in!"); 740 - ret = -EINVAL; 741 - goto out; 742 - #endif 743 711 case Opt_fatal_errors: 744 712 if (strcmp(args[0].from, "panic") == 0) { 745 713 btrfs_set_opt(info->mount_opt, ··· 1262 1306 seq_puts(seq, ",autodefrag"); 1263 1307 if (btrfs_test_opt(info, SKIP_BALANCE)) 1264 1308 seq_puts(seq, ",skip_balance"); 1265 - #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY 1266 - if (btrfs_test_opt(info, CHECK_INTEGRITY_DATA)) 1267 - seq_puts(seq, ",check_int_data"); 1268 - else if (btrfs_test_opt(info, CHECK_INTEGRITY)) 1269 - seq_puts(seq, ",check_int"); 1270 - if (info->check_integrity_print_mask) 1271 - seq_printf(seq, ",check_int_print_mask=%d", 1272 - info->check_integrity_print_mask); 1273 - #endif 1274 1309 if (info->metadata_ratio) 1275 1310 seq_printf(seq, ",metadata_ratio=%u", info->metadata_ratio); 1276 1311 if (btrfs_test_opt(info, PANIC_ON_FATAL_ERROR)) ··· 2351 2404 #endif 2352 2405 #ifdef CONFIG_BTRFS_ASSERT 2353 2406 ", assert=on" 2354 - #endif 2355 - #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY 2356 - ", integrity-checker=on" 2357 2407 #endif 2358 2408 #ifdef CONFIG_BTRFS_FS_REF_VERIFY 2359 2409 ", ref-verify=on"