nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0196-devmapper-getroot-use-makedev-instead-of-direct-shif.patch

f725e3
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
f725e3
From: Andrei Borzenkov <arvidjaar@gmail.com>
f725e3
Date: Sat, 7 Nov 2015 09:46:46 +0300
f725e3
Subject: [PATCH] devmapper/getroot: use makedev instead of direct shift
f725e3
f725e3
Fixes device detection with large number of devices.
f725e3
f725e3
Reported by Tim Wallberg <twalberg@comcast.net>
f725e3
f725e3
(cherry picked from commit 349a381df0ce2e809506f7b166bf952f97407330)
f725e3
f725e3
Resolves: rhbz#1279599
f725e3
---
f725e3
 grub-core/osdep/devmapper/getroot.c | 3 +--
f725e3
 1 file changed, 1 insertion(+), 2 deletions(-)
f725e3
f725e3
diff --git a/grub-core/osdep/devmapper/getroot.c b/grub-core/osdep/devmapper/getroot.c
f725e3
index d02386b3498..de32102322b 100644
f725e3
--- a/grub-core/osdep/devmapper/getroot.c
f725e3
+++ b/grub-core/osdep/devmapper/getroot.c
f725e3
@@ -204,8 +204,7 @@ grub_util_devmapper_part_to_disk (struct stat *st,
f725e3
 					 &major, &minor, 0))
f725e3
     {
f725e3
       *is_part = 1;
f725e3
-      return grub_find_device ("/dev",
f725e3
-			       (major << 8) | minor);
f725e3
+      return grub_find_device ("/dev", makedev (major, minor));
f725e3
     }
f725e3
   *is_part = 0;
f725e3
   return xstrdup (path);