* [PATCH] btrfs-progs: remove data extents from the free space tree
@ 2021-10-05 18:21 Josef Bacik
2021-10-05 22:59 ` Qu Wenruo
2021-10-06 14:37 ` David Sterba
0 siblings, 2 replies; 3+ messages in thread
From: Josef Bacik @ 2021-10-05 18:21 UTC (permalink / raw)
To: linux-btrfs, kernel-team
Dave reported a failure of mkfs-test 009 with the free space tree
enabled by default. This is because 009 pre-populates the file system
with a given directory, and for some reason our data allocation path
isn't the same as in the kernel. Fix this by making sure when we
allocate a data extent we remove the space from the free space tree, and
with this our mkfs tests now pass.
Issue: #410
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
kernel-shared/extent-tree.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kernel-shared/extent-tree.c b/kernel-shared/extent-tree.c
index 4b79874d..90733d55 100644
--- a/kernel-shared/extent-tree.c
+++ b/kernel-shared/extent-tree.c
@@ -3483,6 +3483,12 @@ static int __btrfs_record_file_extent(struct btrfs_trans_handle *trans,
} else if (ret != -EEXIST) {
goto fail;
}
+
+ ret = remove_from_free_space_tree(trans, disk_bytenr,
+ num_bytes);
+ if (ret)
+ goto fail;
+
btrfs_run_delayed_refs(trans, -1);
extent_bytenr = disk_bytenr;
extent_num_bytes = num_bytes;
--
2.26.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs-progs: remove data extents from the free space tree
2021-10-05 18:21 [PATCH] btrfs-progs: remove data extents from the free space tree Josef Bacik
@ 2021-10-05 22:59 ` Qu Wenruo
2021-10-06 14:37 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: Qu Wenruo @ 2021-10-05 22:59 UTC (permalink / raw)
To: Josef Bacik, linux-btrfs, kernel-team
On 2021/10/6 02:21, Josef Bacik wrote:
> Dave reported a failure of mkfs-test 009 with the free space tree
> enabled by default. This is because 009 pre-populates the file system
> with a given directory, and for some reason our data allocation path
> isn't the same as in the kernel.
Mind to share the exact difference between btrfs-progs and kernel?
Just hope we don't miss anything.
Thanks,
Qu
> Fix this by making sure when we
> allocate a data extent we remove the space from the free space tree, and
> with this our mkfs tests now pass.
>
> Issue: #410
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> ---
> kernel-shared/extent-tree.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/kernel-shared/extent-tree.c b/kernel-shared/extent-tree.c
> index 4b79874d..90733d55 100644
> --- a/kernel-shared/extent-tree.c
> +++ b/kernel-shared/extent-tree.c
> @@ -3483,6 +3483,12 @@ static int __btrfs_record_file_extent(struct btrfs_trans_handle *trans,
> } else if (ret != -EEXIST) {
> goto fail;
> }
> +
> + ret = remove_from_free_space_tree(trans, disk_bytenr,
> + num_bytes);
> + if (ret)
> + goto fail;
> +
> btrfs_run_delayed_refs(trans, -1);
> extent_bytenr = disk_bytenr;
> extent_num_bytes = num_bytes;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs-progs: remove data extents from the free space tree
2021-10-05 18:21 [PATCH] btrfs-progs: remove data extents from the free space tree Josef Bacik
2021-10-05 22:59 ` Qu Wenruo
@ 2021-10-06 14:37 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2021-10-06 14:37 UTC (permalink / raw)
To: Josef Bacik; +Cc: linux-btrfs, kernel-team
On Tue, Oct 05, 2021 at 02:21:08PM -0400, Josef Bacik wrote:
> Dave reported a failure of mkfs-test 009 with the free space tree
> enabled by default. This is because 009 pre-populates the file system
> with a given directory, and for some reason our data allocation path
> isn't the same as in the kernel. Fix this by making sure when we
> allocate a data extent we remove the space from the free space tree, and
> with this our mkfs tests now pass.
>
> Issue: #410
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Added to devel, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-10-06 14:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05 18:21 [PATCH] btrfs-progs: remove data extents from the free space tree Josef Bacik
2021-10-05 22:59 ` Qu Wenruo
2021-10-06 14:37 ` David Sterba
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.