Blame SOURCES/0002-major-minor-macros.patch

b3f87c
From f5585f5839b51e734d28059f8a6b6d92ce036d93 Mon Sep 17 00:00:00 2001
b3f87c
From: Vojtech Trefny <vtrefny@redhat.com>
b3f87c
Date: Mon, 17 Dec 2018 10:36:49 +0100
b3f87c
Subject: [PATCH] Use major/minor macros from sys/sysmacros.h instead of
b3f87c
 linux/kdev_t.h
b3f87c
b3f87c
The macros from linux/kdev_t.h don't work for devices with
b3f87c
minor > 255.
b3f87c
b3f87c
Resolves: rhbz#1644825
b3f87c
---
b3f87c
 src/plugins/mpath.c | 14 +++++++-------
b3f87c
 1 file changed, 7 insertions(+), 7 deletions(-)
b3f87c
b3f87c
diff --git a/src/plugins/mpath.c b/src/plugins/mpath.c
b3f87c
index 4fb75849..639c00b9 100644
b3f87c
--- a/src/plugins/mpath.c
b3f87c
+++ b/src/plugins/mpath.c
b3f87c
@@ -18,8 +18,8 @@
b3f87c
  */
b3f87c
 
b3f87c
 #include <glib.h>
b3f87c
-/* provides MAJOR, MINOR macros */
b3f87c
-#include <linux/kdev_t.h>
b3f87c
+/* provides major and minor macros */
b3f87c
+#include <sys/sysmacros.h>
b3f87c
 #include <libdevmapper.h>
b3f87c
 #include <unistd.h>
b3f87c
 #include <blockdev/utils.h>
b3f87c
@@ -273,8 +273,8 @@ static gboolean map_is_multipath (const gchar *map_name, GError **error) {
b3f87c
 static gchar** get_map_deps (const gchar *map_name, guint64 *n_deps, GError **error) {
b3f87c
     struct dm_task *task;
b3f87c
     struct dm_deps *deps;
b3f87c
-    guint64 major = 0;
b3f87c
-    guint64 minor = 0;
b3f87c
+    guint64 dev_major = 0;
b3f87c
+    guint64 dev_minor = 0;
b3f87c
     guint64 i = 0;
b3f87c
     gchar **dep_devs = NULL;
b3f87c
     gchar *major_minor = NULL;
b3f87c
@@ -319,9 +319,9 @@ static gchar** get_map_deps (const gchar *map_name, guint64 *n_deps, GError **er
b3f87c
     dep_devs = g_new0 (gchar*, deps->count + 1);
b3f87c
 
b3f87c
     for (i = 0; i < deps->count; i++) {
b3f87c
-        major = (guint64) MAJOR(deps->device[i]);
b3f87c
-        minor = (guint64) MINOR(deps->device[i]);
b3f87c
-        major_minor = g_strdup_printf ("%"G_GUINT64_FORMAT":%"G_GUINT64_FORMAT, major, minor);
b3f87c
+        dev_major = (guint64) major (deps->device[i]);
b3f87c
+        dev_minor = (guint64) minor (deps->device[i]);
b3f87c
+        major_minor = g_strdup_printf ("%"G_GUINT64_FORMAT":%"G_GUINT64_FORMAT, dev_major, dev_minor);
b3f87c
         dep_devs[i] = get_device_name (major_minor, error);
b3f87c
         if (*error) {
b3f87c
             g_prefix_error (error, "Failed to resolve '%s' to device name",