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

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