btrfs: fix get_root key comparison failures due to endianness
PATCH 1/1 btrfs: fix get_root key comparison failures due to endianness
Key in/out value comparison conditional failing in get_root due to endianess issues.
Signed-off-by Thomas Falcon <[email protected]>
--- grub-core/fs/btrfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/fs/btrfs.c +1 -1
@@ -1201,7 +1201,7 @@ get_root (struct grub_btrfs_data *data, struct grub_btrfs_key *key,struct grub_btrfs_key key_out, key_in;struct grub_btrfs_root_item ri; - key_in.object_id =GRUB_BTRFS_ROOT_VOL_OBJECTID ; + key_in.object_id =grub_cpu_to_le64_compile_time (GRUB_BTRFS_ROOT_VOL_OBJECTID ); key_in.offset =0 ; key_in.type =GRUB_BTRFS_ITEM_TYPE_ROOT_ITEM ; err = lower_bound (data, &key_in, &key_out,
Signature · 1 line
1.8.3.1
Quoted 2 lines · Thomas Falcon
Key in/out value comparison conditional failing in
get_rootdue to endianess issues.
Thanks, this looks sane and consistent with the rest of the code, and from conversation elsewhere I gather that you've tested this in a big-endian context. I wrote a ChangeLog entry for you and pushed this.
Signature · 1 line
Colin Watson [[email protected]]