summaryrefslogtreecommitdiff
path: root/sys-fs
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-04-19 23:55:14 -0400
committerMike Frysinger <vapier@gentoo.org>2016-04-19 23:57:30 -0400
commita45d3e7432ae37620b99109ee771b6f6016280ef (patch)
treed9164ad0fff2f7b37d68da7b03b3c9cdab7fdd36 /sys-fs
parentsys-kernel/genkernel: move to https URLs (diff)
downloadgentoo-a45d3e7432ae37620b99109ee771b6f6016280ef.tar.gz
gentoo-a45d3e7432ae37620b99109ee771b6f6016280ef.tar.bz2
gentoo-a45d3e7432ae37620b99109ee771b6f6016280ef.zip
sys-fs/lvm2: fix build w/newer glibc #580062
Diffstat (limited to 'sys-fs')
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch127
-rw-r--r--sys-fs/lvm2/lvm2-2.02.145-r2.ebuild1
2 files changed, 128 insertions, 0 deletions
diff --git a/sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch b/sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch
new file mode 100644
index 000000000000..f91dccd5c188
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch
@@ -0,0 +1,127 @@
+https://bugs.gentoo.org/580062
+
+From 2a1d0fa8ea765604cd8274aac5aa7876f1c145c9 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 19 Apr 2016 23:53:22 -0400
+Subject: [PATCH] convert major/minor/makedev handling
+
+Most of the files in here use MAJOR/MINOR/MKDEV macros, but a few
+missed it. Update the defines in those files to match them.
+---
+ daemons/cmirrord/functions.c | 16 ++++++++++++----
+ daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c | 12 ++++++++++--
+ lib/filters/filter-sysfs.c | 6 ++++--
+ 3 files changed, 26 insertions(+), 8 deletions(-)
+
+diff --git a/daemons/cmirrord/functions.c b/daemons/cmirrord/functions.c
+index e9d3c09..5b3cb38 100644
+--- a/daemons/cmirrord/functions.c
++++ b/daemons/cmirrord/functions.c
+@@ -20,6 +20,14 @@
+ #include <time.h>
+ #include <unistd.h>
+
++#ifdef __linux__
++# include "kdev_t.h"
++#else
++# define MAJOR(x) major((x))
++# define MINOR(x) minor((x))
++# define MKDEV(x,y) makedev((x),(y))
++#endif
++
+ #define BYTE_SHIFT 3
+
+ /*
+@@ -333,8 +341,8 @@ static int find_disk_path(char *major_minor_str, char *path_rtn, int *unlink_pat
+ continue;
+ }
+ if (S_ISBLK(statbuf.st_mode) &&
+- (major(statbuf.st_rdev) == major) &&
+- (minor(statbuf.st_rdev) == minor)) {
++ (MAJOR(statbuf.st_rdev) == major) &&
++ (MINOR(statbuf.st_rdev) == minor)) {
+ LOG_DBG(" %s: YES", dep->d_name);
+ if (closedir(dp))
+ LOG_DBG("Unable to closedir /dev/mapper %s",
+@@ -1451,7 +1459,7 @@ static int disk_status_info(struct log_c *lc, struct dm_ulog_request *rq)
+ }
+
+ r = sprintf(data, "3 clustered-disk %d:%d %c",
+- major(statbuf.st_rdev), minor(statbuf.st_rdev),
++ MAJOR(statbuf.st_rdev), MINOR(statbuf.st_rdev),
+ (lc->log_dev_failed) ? 'D' : 'A');
+ if (r < 0)
+ return r;
+@@ -1514,7 +1522,7 @@ static int disk_status_table(struct log_c *lc, struct dm_ulog_request *rq)
+ }
+
+ r = sprintf(data, "clustered-disk %d:%d %u %s%s ",
+- major(statbuf.st_rdev), minor(statbuf.st_rdev),
++ MAJOR(statbuf.st_rdev), MINOR(statbuf.st_rdev),
+ lc->region_size,
+ (lc->sync == DEFAULTSYNC) ? "" :
+ (lc->sync == NOSYNC) ? "nosync " : "sync ",
+diff --git a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
+index 7b060ed..4098203 100644
+--- a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
++++ b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
+@@ -20,6 +20,14 @@
+ #include <stdarg.h>
+ #include <pthread.h>
+
++#ifdef __linux__
++# include "kdev_t.h"
++#else
++# define MAJOR(x) major((x))
++# define MINOR(x) minor((x))
++# define MKDEV(x,y) makedev((x),(y))
++#endif
++
+ /* First warning when snapshot is 80% full. */
+ #define WARNING_THRESH (DM_PERCENT_1 * 80)
+ /* Run a check every 5%. */
+@@ -148,8 +156,8 @@ static void _umount(const char *device, int major, int minor)
+ continue; /* can't stat, skip this one */
+
+ if (S_ISBLK(st.st_mode) &&
+- major(st.st_rdev) == major &&
+- minor(st.st_rdev) == minor) {
++ MAJOR(st.st_rdev) == major &&
++ MINOR(st.st_rdev) == minor) {
+ log_error("Unmounting invalid snapshot %s from %s.", device, words[1]);
+ if (!_run(UMOUNT_COMMAND, "-fl", words[1], NULL))
+ log_error("Failed to umount snapshot %s from %s: %s.",
+diff --git a/lib/filters/filter-sysfs.c b/lib/filters/filter-sysfs.c
+index 3115f86..5f76e8b 100644
+--- a/lib/filters/filter-sysfs.c
++++ b/lib/filters/filter-sysfs.c
+@@ -19,6 +19,8 @@
+
+ #include <dirent.h>
+
++#include "kdev_t.h"
++
+ static int _locate_sysfs_blocks(const char *sysfs_dir, char *path, size_t len,
+ unsigned *sysfs_depth)
+ {
+@@ -120,7 +122,7 @@ static struct dev_set *_dev_set_create(struct dm_pool *mem,
+
+ static unsigned _hash_dev(dev_t dev)
+ {
+- return (major(dev) ^ minor(dev)) & (SET_BUCKETS - 1);
++ return (MAJOR(dev) ^ MINOR(dev)) & (SET_BUCKETS - 1);
+ }
+
+ /*
+@@ -171,7 +173,7 @@ static int _parse_dev(const char *file, FILE *fp, dev_t *result)
+ return 0;
+ }
+
+- *result = makedev(major, minor);
++ *result = MKDEV(major, minor);
+ return 1;
+ }
+
+--
+2.7.4
+
diff --git a/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild b/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
index 4db87a29c059..0970c2f021b8 100644
--- a/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
+++ b/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
@@ -68,6 +68,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-2.02.139-dynamic-static-ldflags.patch #332905
"${FILESDIR}"/${PN}-2.02.129-static-pkgconfig-libs.patch #370217, #439414 + blkid
"${FILESDIR}"/${PN}-2.02.130-pthread-pkgconfig.patch #492450
+ "${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062
)
pkg_setup() {