Message ID | 34ac8f222d475d692faa8d325cf63b5196912644.1692800904.git.josef@toxicpanda.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs-progs: sync ctree.c into btrfs-progs | expand |
On 2023/8/23 22:32, Josef Bacik wrote: > We are calling this when creating the UUID tree, however when we create > the tree it inserts the root item into the tree_root, so this call is > superfluous. > > Signed-off-by: Josef Bacik <josef@toxicpanda.com> Unfortunately this patch is causing extent buffer leakage. (Thanks Anand for finding it) The latest devel branch would cause two eb leaks, one for uuid tree (caused by this one), another eb would be from free space tree. We can remove this one, but we need to add those dirty trees to dirty cowonly tree lists at least in btrfs_create_tree(). Unfortunately this means we still need to export add_root_to_dirty_list(), and would cause conflicts with later patches. Thanks, Qu > --- > mkfs/main.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/mkfs/main.c b/mkfs/main.c > index 1c5d668e..1b917f55 100644 > --- a/mkfs/main.c > +++ b/mkfs/main.c > @@ -789,7 +789,6 @@ static int create_uuid_tree(struct btrfs_trans_handle *trans) > goto out; > } > > - add_root_to_dirty_list(root); > fs_info->uuid_root = root; > ret = btrfs_uuid_tree_add(trans, fs_info->fs_root->root_item.uuid, > BTRFS_UUID_KEY_SUBVOL,
On 2023/8/29 14:32, Qu Wenruo wrote: > > > On 2023/8/23 22:32, Josef Bacik wrote: >> We are calling this when creating the UUID tree, however when we create >> the tree it inserts the root item into the tree_root, so this call is >> superfluous. >> >> Signed-off-by: Josef Bacik <josef@toxicpanda.com> > > Unfortunately this patch is causing extent buffer leakage. (Thanks Anand > for finding it) > > The latest devel branch would cause two eb leaks, one for uuid tree > (caused by this one), another eb would be from free space tree. My bad, the other one is from data reloc tree, not free space tree. Thanks, Qu > > We can remove this one, but we need to add those dirty trees to dirty > cowonly tree lists at least in btrfs_create_tree(). > > Unfortunately this means we still need to export > add_root_to_dirty_list(), and would cause conflicts with later patches. > > Thanks, > Qu >> --- >> mkfs/main.c | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/mkfs/main.c b/mkfs/main.c >> index 1c5d668e..1b917f55 100644 >> --- a/mkfs/main.c >> +++ b/mkfs/main.c >> @@ -789,7 +789,6 @@ static int create_uuid_tree(struct >> btrfs_trans_handle *trans) >> goto out; >> } >> >> - add_root_to_dirty_list(root); >> fs_info->uuid_root = root; >> ret = btrfs_uuid_tree_add(trans, fs_info->fs_root->root_item.uuid, >> BTRFS_UUID_KEY_SUBVOL,
diff --git a/mkfs/main.c b/mkfs/main.c index 1c5d668e..1b917f55 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -789,7 +789,6 @@ static int create_uuid_tree(struct btrfs_trans_handle *trans) goto out; } - add_root_to_dirty_list(root); fs_info->uuid_root = root; ret = btrfs_uuid_tree_add(trans, fs_info->fs_root->root_item.uuid, BTRFS_UUID_KEY_SUBVOL,
We are calling this when creating the UUID tree, however when we create the tree it inserts the root item into the tree_root, so this call is superfluous. Signed-off-by: Josef Bacik <josef@toxicpanda.com> --- mkfs/main.c | 1 - 1 file changed, 1 deletion(-)