btrfs-progs: tests/fsck: Add test case to check if btrfs check can skip data csum...
[platform/upstream/btrfs-progs.git] / uuid-tree.c
index 39c3f3f..320eb67 100644 (file)
@@ -60,9 +60,9 @@ static int btrfs_uuid_tree_lookup_any(int fd, const u8 *uuid, u8 type,
        ret = ioctl(fd, BTRFS_IOC_TREE_SEARCH, &search_arg);
        if (ret < 0) {
                fprintf(stderr,
-                       "ioctl(BTRFS_IOC_TREE_SEARCH, uuid, key %016llx, UUID_KEY, %016llx) ret=%d, error: %s\n",
+                       "ioctl(BTRFS_IOC_TREE_SEARCH, uuid, key %016llx, UUID_KEY, %016llx) ret=%d, error: %m\n",
                        (unsigned long long)key_objectid,
-                       (unsigned long long)key_offset, ret, strerror(errno));
+                       (unsigned long long)key_offset, ret);
                ret = -ENOENT;
                goto out;
        }
@@ -72,7 +72,7 @@ static int btrfs_uuid_tree_lookup_any(int fd, const u8 *uuid, u8 type,
                goto out;
        }
        search_header = (struct btrfs_ioctl_search_header *)(search_arg.buf);
-       item_size = search_header->len;
+       item_size = btrfs_search_header_len(search_header);
        if ((item_size & (sizeof(u64) - 1)) || item_size == 0) {
                printf("btrfs: uuid item with illegal size %lu!\n",
                       (unsigned long)item_size);