aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2024-03-16 18:13:04 +0100
committerDavid Sterba <dsterba@suse.com>2024-03-16 18:13:04 +0100
commitd73e698248547d0a600f5105985e99815ba69ac5 (patch)
treee030e78bb043fc716e789a567fbf8685d7762130
parenta223764093b1d78403b55787028b8a01fef2f023 (diff)
downloadbtrfs-progs-d73e698248547d0a600f5105985e99815ba69ac5.tar.gz
btrfs-progs: temporarily disable usage of v2 of search tree ioctl
For unclear reasons using the v2 ioctl leads to an infinite loop in 'btrfs fi usage' in load_chunk_info() when there's only one valid item returned and then it keeps looping. Can be reproduced by mkfs-tests/001. After debugging, from second item in the buffer there's all zeros, while it's returned nr_items=4. Switching the same code to use v1 makes it work again. It's puzzling as it's the same code in kernel. We want to make the switch eventually so only disable the detection so other code can use the new API. Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--common/fsfeatures.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/fsfeatures.c b/common/fsfeatures.c
index 2c43eae5..02d13f60 100644
--- a/common/fsfeatures.c
+++ b/common/fsfeatures.c
@@ -691,8 +691,14 @@ int btrfs_tree_search_ioctl(int fd, struct btrfs_tree_search_args *sa)
{
/* On first use check the supported status and save it. */
if (!tree_search_v2_initialized) {
+#if 0
+ /*
+ * Keep using v1 until v2 is fully tested, in some cases it
+ * does not return properly formatted results in the buffer.
+ */
if (btrfs_tree_search2_ioctl_supported(fd) == 1)
tree_search_v2_supported = true;
+#endif
tree_search_v2_initialized = true;
}
sa->use_v2 = tree_search_v2_supported;