<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Jul 30, 2018 at 9:16 PM Eric Blake <<a href="mailto:eblake@redhat.com">eblake@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 07/30/2018 01:04 PM, Nir Soffer wrote:<br>
> On RHEL 7.5 we need to include <linux/falloc.h> for FALLOC_FL_* macros.<br>
<br>
Rather, on any Linux system that pre-dates glibc 2.18, where the flags <br>
were finally supported directly in <fcntl.h><br>
<br>
> Without the macros, fallocate is never used and we fall back to manual<br>
> zeroing.<br>
> <br>
<br>
> +++ b/plugins/file/file.c<br>
> @@ -42,6 +42,10 @@<br>
>   #include <sys/stat.h><br>
>   #include <errno.h><br>
>   <br>
> +#if defined(__linux__)<br>
> +#include <linux/falloc.h>   /* For FALLOC_FL_* on RHEL, glibc < 2.18 */<br>
<br>
Doesn't mention which version of RHEL, nor the fact that non-RHEL <br>
systems may also be impacted (it is the glibc version that matters here, <br>
rather than the distro).<br>
<br>
> +#endif<br>
> +<br>
<br>
ACK.<br>
<br>
Perhaps could be made tighter, with a less ambiguous comment, as:<br>
<br>
#if defined(__linux__) && !defined(FALLOC_FL_PUNCH_HOLE)<br>
# include <linux/falloc.h>  /* For FALLOC_FL_*, on glibc < 2.18 */<br>
#endif<br>
<br>
but let's see if Rich has any preference between the two.<br></blockquote><div><br></div><div>Both changes are better, I'll post v3 if Rich prefer this.</div><div><br></div><div>Nir</div></div></div>