Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zfs_btree_verify_intensity kernel module parameter #13874

Merged
merged 1 commit into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/zdb/zdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ extern int zfs_vdev_async_read_max_active;
extern boolean_t spa_load_verify_dryrun;
extern boolean_t spa_mode_readable_spacemaps;
extern int zfs_reconstruct_indirect_combinations_max;
extern int zfs_btree_verify_intensity;
extern uint_t zfs_btree_verify_intensity;

static const char cmdname[] = "zdb";
uint8_t dump_opt[256];
Expand Down
16 changes: 16 additions & 0 deletions man/man4/zfs.4
Original file line number Diff line number Diff line change
Expand Up @@ -1354,6 +1354,22 @@ _
.TE
.Sy \& * No Requires debug build.
.
.It Sy zfs_btree_verify_intensity Ns = Ns Sy 0 Pq uint
Enables btree verification.
The following settings are culminative:
ryao marked this conversation as resolved.
Show resolved Hide resolved
.TS
box;
lbz r l l .
Value Description

1 Verify height.
2 Verify pointers from children to parent.
3 Verify element counts.
4 Verify element order. (expensive)
* 5 Verify unused memory is poisoned. (expensive)
.TE
.Sy \& * No Requires debug build.
.
.It Sy zfs_free_leak_on_eio Ns = Ns Sy 0 Ns | Ns 1 Pq int
If destroy encounters an
.Sy EIO
Expand Down
8 changes: 7 additions & 1 deletion module/zfs/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ kmem_cache_t *zfs_btree_leaf_cache;
* (while the asymptotic complexity of the other steps is the same, the
* importance of the constant factors cannot be denied).
*/
int zfs_btree_verify_intensity = 0;
uint_t zfs_btree_verify_intensity = 0;

/*
* Convenience functions to silence warnings from memcpy/memmove's
Expand Down Expand Up @@ -2171,3 +2171,9 @@ zfs_btree_verify(zfs_btree_t *tree)
return;
zfs_btree_verify_poison(tree);
}

/* BEGIN CSTYLED */
ZFS_MODULE_PARAM(zfs, zfs_, btree_verify_intensity, UINT, ZMOD_RW,
behlendorf marked this conversation as resolved.
Show resolved Hide resolved
"Enable btree verification. Levels above 4 require ZFS be built "
"with debugging");
/* END CSTYLED */