path: root/free-space-cache.c
diff options
authorDavid Sterba <>2017-09-23 21:00:41 +0200
committerDavid Sterba <>2017-09-25 15:18:27 +0200
commitb4b069dcb22bd707775c3c649d77124ed006e39f (patch)
treec672453bf399dd4d06ac7948c683544873afc644 /free-space-cache.c
parent510a282f7f17ec3541a0f6845cb100847aa6857f (diff)
btrfs-progs: free-space-cache: fix endianity when reading from disk_key
Sparse reports: free-space-cache.c:921:13: warning: incorrect type in assignment (different base types) free-space-cache.c:921:13: expected unsigned long long [unsigned] [usertype] ino free-space-cache.c:921:13: got restricted __le64 [addressable] [usertype] objectid we need to use the helper to read objectid, as read_eb_member just copies the data without disk->cpu transformation. This could lead to bogus results on bigendian machines. Signed-off-by: David Sterba <>
Diffstat (limited to 'free-space-cache.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/free-space-cache.c b/free-space-cache.c
index 4bf4a6cb..50356d04 100644
--- a/free-space-cache.c
+++ b/free-space-cache.c
@@ -918,7 +918,7 @@ int btrfs_clear_free_space_cache(struct btrfs_fs_info *fs_info,
slot = path.slots[0];
sc_header = btrfs_item_ptr(node, slot, struct btrfs_free_space_header);
btrfs_free_space_key(node, sc_header, &location);
- ino = location.objectid;
+ ino = btrfs_disk_key_objectid(&location);
/* Delete the free space header, as we have the ino to continue */
ret = btrfs_del_item(trans, tree_root, &path);