linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libext2fs: check for fallocate symbol before using it
@ 2012-03-05  5:36 Mike Frysinger
  2012-03-07  1:22 ` Ted Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2012-03-05  5:36 UTC (permalink / raw)
  To: linux-ext4

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-07 16:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-05  5:36 [PATCH] libext2fs: check for fallocate symbol before using it Mike Frysinger
2012-03-07  1:22 ` Ted Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).