dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0071-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch

4fe85b
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
4fe85b
From: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
4fe85b
Date: Mon, 31 Mar 2014 15:32:30 +0100
4fe85b
Subject: [PATCH] btrfs: fix get_root key comparison failures due to endianness
4fe85b
4fe85b
* grub-core/fs/btrfs.c (get_root): Convert
4fe85b
GRUB_BTRFS_ROOT_VOL_OBJECTID to little-endian.
4fe85b
---
4fe85b
 grub-core/fs/btrfs.c | 2 +-
4fe85b
 ChangeLog            | 7 +++++++
4fe85b
 2 files changed, 8 insertions(+), 1 deletion(-)
4fe85b
4fe85b
diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
4fe85b
index 89666b6fd59..f7b6c152037 100644
4fe85b
--- a/grub-core/fs/btrfs.c
4fe85b
+++ b/grub-core/fs/btrfs.c
4fe85b
@@ -1201,7 +1201,7 @@ get_root (struct grub_btrfs_data *data, struct grub_btrfs_key *key,
4fe85b
   struct grub_btrfs_key key_out, key_in;
4fe85b
   struct grub_btrfs_root_item ri;
4fe85b
 
4fe85b
-  key_in.object_id = GRUB_BTRFS_ROOT_VOL_OBJECTID;
4fe85b
+  key_in.object_id = grub_cpu_to_le64_compile_time (GRUB_BTRFS_ROOT_VOL_OBJECTID);
4fe85b
   key_in.offset = 0;
4fe85b
   key_in.type = GRUB_BTRFS_ITEM_TYPE_ROOT_ITEM;
4fe85b
   err = lower_bound (data, &key_in, &key_out,
4fe85b
diff --git a/ChangeLog b/ChangeLog
4fe85b
index 1cb3b683fcf..accffade86b 100644
4fe85b
--- a/ChangeLog
4fe85b
+++ b/ChangeLog
4fe85b
@@ -1,3 +1,10 @@
4fe85b
+2014-03-31  Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
4fe85b
+
4fe85b
+	btrfs: fix get_root key comparison failures due to endianness
4fe85b
+
4fe85b
+	* grub-core/fs/btrfs.c (get_root): Convert
4fe85b
+	GRUB_BTRFS_ROOT_VOL_OBJECTID to little-endian.
4fe85b
+
4fe85b
 2014-03-31  Colin Watson  <cjwatson@ubuntu.com>
4fe85b
 
4fe85b
 	Fix partmap, cryptodisk, and abstraction handling in grub-mkconfig.