diff mbox series

arch/um: falloc.h needs to be directly included for older libc

Message ID 1584466534-13248-1-git-send-email-alan.maguire@oracle.com
State Accepted
Headers show
Series arch/um: falloc.h needs to be directly included for older libc | expand

Commit Message

Alan Maguire March 17, 2020, 5:35 p.m. UTC
When building UML with glibc 2.17 installed, compilation
of arch/um/os-Linux/file.c fails due to failure to find
FALLOC_FL_PUNCH_HOLE and FALLOC_FL_KEEP_SIZE definitions.

It appears that /usr/include/bits/fcntl-linux.h (indirectly
included by /usr/include/fcntl.h) does not include falloc.h
with an older glibc, whereas a more up-to-date version
does.

Adding the direct include to file.c resolves the issue
and does not cause problems for more recent glibc.

Fixes: 50109b5a03b4 ("um: Add support for DISCARD in the UBD Driver")
Cc: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
---
 arch/um/os-Linux/file.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Brendan Higgins March 17, 2020, 7 p.m. UTC | #1
On Tue, Mar 17, 2020 at 10:38 AM Alan Maguire <alan.maguire@oracle.com> wrote:
>
> When building UML with glibc 2.17 installed, compilation
> of arch/um/os-Linux/file.c fails due to failure to find
> FALLOC_FL_PUNCH_HOLE and FALLOC_FL_KEEP_SIZE definitions.
>
> It appears that /usr/include/bits/fcntl-linux.h (indirectly
> included by /usr/include/fcntl.h) does not include falloc.h
> with an older glibc, whereas a more up-to-date version
> does.
>
> Adding the direct include to file.c resolves the issue
> and does not cause problems for more recent glibc.
>
> Fixes: 50109b5a03b4 ("um: Add support for DISCARD in the UBD Driver")
> Cc: Brendan Higgins <brendanhiggins@google.com>
> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>

Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Anton Ivanov March 20, 2020, 3:57 p.m. UTC | #2
On 17/03/2020 17:35, Alan Maguire wrote:
> When building UML with glibc 2.17 installed, compilation
> of arch/um/os-Linux/file.c fails due to failure to find
> FALLOC_FL_PUNCH_HOLE and FALLOC_FL_KEEP_SIZE definitions.
> 
> It appears that /usr/include/bits/fcntl-linux.h (indirectly
> included by /usr/include/fcntl.h) does not include falloc.h
> with an older glibc, whereas a more up-to-date version
> does.
> 
> Adding the direct include to file.c resolves the issue
> and does not cause problems for more recent glibc.
> 
> Fixes: 50109b5a03b4 ("um: Add support for DISCARD in the UBD Driver")
> Cc: Brendan Higgins <brendanhiggins@google.com>
> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
> ---
>   arch/um/os-Linux/file.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
> index fbda105..5c819f8 100644
> --- a/arch/um/os-Linux/file.c
> +++ b/arch/um/os-Linux/file.c
> @@ -8,6 +8,7 @@
>   #include <errno.h>
>   #include <fcntl.h>
>   #include <signal.h>
> +#include <linux/falloc.h>
>   #include <sys/ioctl.h>
>   #include <sys/mount.h>
>   #include <sys/socket.h>
> 

Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Richard Weinberger March 29, 2020, 9:41 p.m. UTC | #3
On Fri, Mar 20, 2020 at 4:58 PM Anton Ivanov
<anton.ivanov@cambridgegreys.com> wrote:
>
>
>
> On 17/03/2020 17:35, Alan Maguire wrote:
> > When building UML with glibc 2.17 installed, compilation
> > of arch/um/os-Linux/file.c fails due to failure to find
> > FALLOC_FL_PUNCH_HOLE and FALLOC_FL_KEEP_SIZE definitions.
> >
> > It appears that /usr/include/bits/fcntl-linux.h (indirectly
> > included by /usr/include/fcntl.h) does not include falloc.h
> > with an older glibc, whereas a more up-to-date version
> > does.
> >
> > Adding the direct include to file.c resolves the issue
> > and does not cause problems for more recent glibc.
> >
> > Fixes: 50109b5a03b4 ("um: Add support for DISCARD in the UBD Driver")
> > Cc: Brendan Higgins <brendanhiggins@google.com>
> > Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
> > ---
> >   arch/um/os-Linux/file.c | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
> > index fbda105..5c819f8 100644
> > --- a/arch/um/os-Linux/file.c
> > +++ b/arch/um/os-Linux/file.c
> > @@ -8,6 +8,7 @@
> >   #include <errno.h>
> >   #include <fcntl.h>
> >   #include <signal.h>
> > +#include <linux/falloc.h>
> >   #include <sys/ioctl.h>
> >   #include <sys/mount.h>
> >   #include <sys/socket.h>
> >
>
> Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>

Applied, thanks!

BTW: Anton & Brendan, thanks a lot for reviewing all these patches!
diff mbox series

Patch

diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
index fbda105..5c819f8 100644
--- a/arch/um/os-Linux/file.c
+++ b/arch/um/os-Linux/file.c
@@ -8,6 +8,7 @@ 
 #include <errno.h>
 #include <fcntl.h>
 #include <signal.h>
+#include <linux/falloc.h>
 #include <sys/ioctl.h>
 #include <sys/mount.h>
 #include <sys/socket.h>