diff --git a/lib/fs.cc b/lib/fs.cc index 2b2793d..69e398c 100644 --- a/lib/fs.cc +++ b/lib/fs.cc @@ -823,6 +823,8 @@ namespace crucible { ioctl_ptr->buf_size = m_buf_size; + m_result.clear(); + // Don't bother supporting V1. Kernels that old have other problems. int rv = ioctl(fd, BTRFS_IOC_TREE_SEARCH_V2, ioctl_ptr); if (rv != 0) { @@ -831,8 +833,6 @@ namespace crucible { static_cast(*this) = ioctl_ptr->key; - m_result.clear(); - size_t offset = pointer_distance(ioctl_ptr->buf, ioctl_ptr); for (decltype(nr_items) i = 0; i < nr_items; ++i) { BtrfsIoctlSearchHeader item;