All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: [PATCH] btrfs-progs: remove data extents from the free space tree
Date: Tue,  5 Oct 2021 14:21:08 -0400	[thread overview]
Message-ID: <0394a30e2d64f3a418c7f502a967b9add5632577.1633458057.git.josef@toxicpanda.com> (raw)

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


             reply	other threads:[~2021-10-05 18:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05 18:21 Josef Bacik [this message]
2021-10-05 22:59 ` [PATCH] btrfs-progs: remove data extents from the free space tree Qu Wenruo
2021-10-06 14:37 ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0394a30e2d64f3a418c7f502a967b9add5632577.1633458057.git.josef@toxicpanda.com \
    --to=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.