projects
/
platform
/
upstream
/
btrfs-progs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
btrfs-progs: disk-io: Fix read_extent_data() error handler for missing device
[platform/upstream/btrfs-progs.git]
/
uuid-tree.c
diff --git
a/uuid-tree.c
b/uuid-tree.c
index
3a4c48e
..
320eb67
100644
(file)
--- a/
uuid-tree.c
+++ b/
uuid-tree.c
@@
-43,6
+43,7
@@
static int btrfs_uuid_tree_lookup_any(int fd, const u8 *uuid, u8 type,
struct btrfs_ioctl_search_args search_arg;
struct btrfs_ioctl_search_header *search_header;
u32 item_size;
struct btrfs_ioctl_search_args search_arg;
struct btrfs_ioctl_search_header *search_header;
u32 item_size;
+ __le64 lesubid;
btrfs_uuid_to_key(uuid, &key_objectid, &key_offset);
btrfs_uuid_to_key(uuid, &key_objectid, &key_offset);
@@
-59,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,
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_objectid,
- (unsigned long long)key_offset, ret
, strerror(errno)
);
+ (unsigned long long)key_offset, ret);
ret = -ENOENT;
goto out;
}
ret = -ENOENT;
goto out;
}
@@
-71,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);
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);
if ((item_size & (sizeof(u64) - 1)) || item_size == 0) {
printf("btrfs: uuid item with illegal size %lu!\n",
(unsigned long)item_size);
@@
-82,8
+83,8
@@
static int btrfs_uuid_tree_lookup_any(int fd, const u8 *uuid, u8 type,
}
/* return first stored id */
}
/* return first stored id */
- memcpy(
subid, search_header + 1, sizeof(*
subid));
- *subid = le64_to_cpu(
*
subid);
+ memcpy(
&lesubid, search_header + 1, sizeof(le
subid));
+ *subid = le64_to_cpu(
le
subid);
out:
return ret;
out:
return ret;