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

btree walker doesn't work #329

Open
ahrens opened this issue Jun 28, 2023 · 0 comments
Open

btree walker doesn't work #329

ahrens opened this issue Jun 28, 2023 · 0 comments

Comments

@ahrens
Copy link
Contributor

ahrens commented Jun 28, 2023

Expected Behavior

sdb> echo 0xffff9b2e51316a18 | cast zfs_btree_t* | deref
(zfs_btree_t){
	.bt_compar = (int (*)(const void *, const void *))removal_block_compare+0x0 = 0xffffffffc03a57c0,
	.bt_find_in_buf = (bt_find_in_buf_f)zfs_btree_find_in_buf+0x0 = 0xffffffffc028bad0,
	.bt_elem_size = (size_t)8,
	.bt_leaf_size = (size_t)4096,
	.bt_leaf_cap = (uint32_t)510,
	.bt_height = (int32_t)2,
	.bt_num_elems = (uint64_t)262715,
	.bt_num_nodes = (uint64_t)968,
	.bt_root = (zfs_btree_hdr_t *)0xffff9b2fbe7ec000,
	.bt_bulk = (zfs_btree_leaf_t *)0x0,
}

walker should visit bt_num_elems = 262715 values
Actual Behavior

sdb> echo 0xffff9b2e51316a18 | cast zfs_btree_t* | walk
(void *)0xffff9b37be7ec008
(void *)0xffff9b2fbe7ec010
(void *)0xffff9b2fbe7ec018
(void *)0xffff9b2fbe7ec020
(void *)0xffff9b2fbe7ec028
(void *)0xffff9b2fbe7ec030
(void *)0xffff9b2fbe7ec038
(void *)0xffff9b2fbe7ec040
(void *)0xffff9b2fbe7ec048
(void *)0xffff9b2fbe7ec050
(void *)0xffff9b2fbe7ec058
(void *)0xffff9b2fbe7ec060
(void *)0xffff9b2fbe7ec068
sdb> echo 0xffff9b2e51316a18 | cast zfs_btree_t* | walk | wc
(unsigned long long)13

Looks like maybe it's visiting the children of the root node?

sdb> echo 0xffff9b2e51316a18 | cast zfs_btree_t* | member bt_root | deref
(zfs_btree_hdr_t){
	.bth_parent = (struct zfs_btree_core *)0x0,
	.bth_first = (uint32_t)4294967295,
	.bth_count = (uint32_t)13,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant