Skip to content

Commit 732fab9

Browse files
adam900710kdave
authored andcommitted
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>
1 parent fb2a836 commit 732fab9

File tree

4 files changed

+11
-121
lines changed

4 files changed

+11
-121
lines changed

fs/btrfs/Kconfig

-21
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,6 @@ config BTRFS_FS_POSIX_ACL
4848

4949
If you don't know what Access Control Lists are, say N
5050

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-
7251
config BTRFS_FS_RUN_SANITY_TESTS
7352
bool "Btrfs will run sanity tests upon loading"
7453
depends on BTRFS_FS

fs/btrfs/disk-io.c

-28
Original file line numberDiff line numberDiff line change
@@ -2736,9 +2736,6 @@ void btrfs_init_fs_info(struct btrfs_fs_info *fs_info)
27362736
spin_lock_init(&fs_info->ordered_root_lock);
27372737

27382738
btrfs_init_scrub(fs_info);
2739-
#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
2740-
fs_info->check_integrity_print_mask = 0;
2741-
#endif
27422739
btrfs_init_balance(fs_info);
27432740
btrfs_init_async_reclaim_work(fs_info);
27442741

@@ -3904,21 +3901,6 @@ static void write_dev_flush(struct btrfs_device *device)
39043901

39053902
device->last_flush_error = BLK_STS_OK;
39063903

3907-
#ifndef CONFIG_BTRFS_FS_CHECK_INTEGRITY
3908-
/*
3909-
* When a disk has write caching disabled, we skip submission of a bio
3910-
* with flush and sync requests before writing the superblock, since
3911-
* it's not needed. However when the integrity checker is enabled, this
3912-
* results in reports that there are metadata blocks referred by a
3913-
* superblock that were not properly flushed. So don't skip the bio
3914-
* submission only when the integrity checker is enabled for the sake
3915-
* of simplicity, since this is a debug tool and not meant for use in
3916-
* non-debug builds.
3917-
*/
3918-
if (!bdev_write_cache(device->bdev))
3919-
return;
3920-
#endif
3921-
39223904
bio_init(bio, device->bdev, NULL, 0,
39233905
REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH);
39243906
bio->bi_end_io = btrfs_end_empty_barrier;
@@ -4422,16 +4404,6 @@ void btrfs_mark_buffer_dirty(struct extent_buffer *buf)
44224404
WARN(1, KERN_CRIT "btrfs transid mismatch buffer %llu, found %llu running %llu\n",
44234405
buf->start, transid, fs_info->generation);
44244406
set_extent_buffer_dirty(buf);
4425-
#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
4426-
/*
4427-
* btrfs_check_leaf() won't check item data if we don't have WRITTEN
4428-
* set, so this will only validate the basic structure of the items.
4429-
*/
4430-
if (btrfs_header_level(buf) == 0 && btrfs_check_leaf(buf)) {
4431-
btrfs_print_leaf(buf);
4432-
ASSERT(0);
4433-
}
4434-
#endif
44354407
}
44364408

44374409
static void __btrfs_btree_balance_dirty(struct btrfs_fs_info *fs_info,

fs/btrfs/fs.h

+11-16
Original file line numberDiff line numberDiff line change
@@ -171,19 +171,17 @@ enum {
171171
BTRFS_MOUNT_AUTO_DEFRAG = (1UL << 16),
172172
BTRFS_MOUNT_USEBACKUPROOT = (1UL << 17),
173173
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),
187185
};
188186

189187
/*
@@ -645,9 +643,6 @@ struct btrfs_fs_info {
645643

646644
struct btrfs_discard_ctl discard_ctl;
647645

648-
#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
649-
u32 check_integrity_print_mask;
650-
#endif
651646
/* Is qgroup tracking in a consistent state? */
652647
u64 qgroup_flags;
653648

fs/btrfs/super.c

-56
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,6 @@ enum {
130130
Opt_inode_cache, Opt_noinode_cache,
131131

132132
/* Debugging options */
133-
Opt_check_integrity,
134-
Opt_check_integrity_including_extent_data,
135-
Opt_check_integrity_print_mask,
136133
Opt_enospc_debug, Opt_noenospc_debug,
137134
#ifdef CONFIG_BTRFS_DEBUG
138135
Opt_fragment_data, Opt_fragment_metadata, Opt_fragment_all,
@@ -201,9 +198,6 @@ static const match_table_t tokens = {
201198
{Opt_recovery, "recovery"},
202199

203200
/* Debugging options */
204-
{Opt_check_integrity, "check_int"},
205-
{Opt_check_integrity_including_extent_data, "check_int_data"},
206-
{Opt_check_integrity_print_mask, "check_int_print_mask=%u"},
207201
{Opt_enospc_debug, "enospc_debug"},
208202
{Opt_noenospc_debug, "noenospc_debug"},
209203
#ifdef CONFIG_BTRFS_DEBUG
@@ -708,44 +702,6 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
708702
case Opt_skip_balance:
709703
btrfs_set_opt(info->mount_opt, SKIP_BALANCE);
710704
break;
711-
#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
712-
case Opt_check_integrity_including_extent_data:
713-
btrfs_warn(info,
714-
"integrity checker is deprecated and will be removed in 6.7");
715-
btrfs_info(info,
716-
"enabling check integrity including extent data");
717-
btrfs_set_opt(info->mount_opt, CHECK_INTEGRITY_DATA);
718-
btrfs_set_opt(info->mount_opt, CHECK_INTEGRITY);
719-
break;
720-
case Opt_check_integrity:
721-
btrfs_warn(info,
722-
"integrity checker is deprecated and will be removed in 6.7");
723-
btrfs_info(info, "enabling check integrity");
724-
btrfs_set_opt(info->mount_opt, CHECK_INTEGRITY);
725-
break;
726-
case Opt_check_integrity_print_mask:
727-
ret = match_int(&args[0], &intarg);
728-
if (ret) {
729-
btrfs_err(info,
730-
"unrecognized check_integrity_print_mask value %s",
731-
args[0].from);
732-
goto out;
733-
}
734-
info->check_integrity_print_mask = intarg;
735-
btrfs_warn(info,
736-
"integrity checker is deprecated and will be removed in 6.7");
737-
btrfs_info(info, "check_integrity_print_mask 0x%x",
738-
info->check_integrity_print_mask);
739-
break;
740-
#else
741-
case Opt_check_integrity_including_extent_data:
742-
case Opt_check_integrity:
743-
case Opt_check_integrity_print_mask:
744-
btrfs_err(info,
745-
"support for check_integrity* not compiled in!");
746-
ret = -EINVAL;
747-
goto out;
748-
#endif
749705
case Opt_fatal_errors:
750706
if (strcmp(args[0].from, "panic") == 0) {
751707
btrfs_set_opt(info->mount_opt,
@@ -1306,15 +1262,6 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry)
13061262
seq_puts(seq, ",autodefrag");
13071263
if (btrfs_test_opt(info, SKIP_BALANCE))
13081264
seq_puts(seq, ",skip_balance");
1309-
#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
1310-
if (btrfs_test_opt(info, CHECK_INTEGRITY_DATA))
1311-
seq_puts(seq, ",check_int_data");
1312-
else if (btrfs_test_opt(info, CHECK_INTEGRITY))
1313-
seq_puts(seq, ",check_int");
1314-
if (info->check_integrity_print_mask)
1315-
seq_printf(seq, ",check_int_print_mask=%d",
1316-
info->check_integrity_print_mask);
1317-
#endif
13181265
if (info->metadata_ratio)
13191266
seq_printf(seq, ",metadata_ratio=%u", info->metadata_ratio);
13201267
if (btrfs_test_opt(info, PANIC_ON_FATAL_ERROR))
@@ -2405,9 +2352,6 @@ static int __init btrfs_print_mod_info(void)
24052352
#ifdef CONFIG_BTRFS_ASSERT
24062353
", assert=on"
24072354
#endif
2408-
#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
2409-
", integrity-checker=on"
2410-
#endif
24112355
#ifdef CONFIG_BTRFS_FS_REF_VERIFY
24122356
", ref-verify=on"
24132357
#endif

0 commit comments

Comments
 (0)