summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-fs/e2fsprogs/files/e2fsprogs-1.42-no-fallocate.patch')
-rw-r--r--sys-fs/e2fsprogs/files/e2fsprogs-1.42-no-fallocate.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.42-no-fallocate.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.42-no-fallocate.patch
new file mode 100644
index 000000000000..17594e47e87e
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsprogs-1.42-no-fallocate.patch
@@ -0,0 +1,33 @@
+https://bugs.gentoo.org/406609
+
+From 1a36d2ead2f45a21f74ccc332a534c1b788d6029 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 5 Mar 2012 00:35:21 -0500
+Subject: [PATCH] libext2fs: check for fallocate symbol before using it
+
+If we have newer kernel headers which define FALLOC_FL_PUNCH_HOLE, but we
+are on an older glibc which lacks fallocate, we end up trying to use the
+func anyways. Check the ifdef that autoconf already set up for us.
+
+Reported-by: Ortwin Glueck <odi@odi.ch>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ lib/ext2fs/unix_io.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c
+index 9f0613a..da3f8fd 100644
+--- a/lib/ext2fs/unix_io.c
++++ b/lib/ext2fs/unix_io.c
+@@ -905,7 +905,7 @@ static errcode_t unix_discard(io_channel channel, unsigned long long block,
+ goto unimplemented;
+ #endif
+ } else {
+-#ifdef FALLOC_FL_PUNCH_HOLE
++#if defined(HAVE_FALLOCATE) && defined(FALLOC_FL_PUNCH_HOLE)
+ /*
+ * If we are not on block device, try to use punch hole
+ * to reclaim free space.
+--
+1.7.8.4
+