blob: 7b6dc270e1d2ca9ed334dc85930dd9ac5e872abb [file] [log] [blame]
From 0123629131021a2894f0fa5350ab199024c79bb8 Mon Sep 17 00:00:00 2001
From: Alan Maguire <>
Date: Tue, 17 Mar 2020 17:35:34 +0000
Subject: [PATCH] um: falloc.h needs to be directly included for older libc
commit 35f3401317a3b26aa01fde8facfd320f2628fdcc upstream.
When building UML with glibc 2.17 installed, compilation
of arch/um/os-Linux/file.c fails due to failure to find
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
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 <>
Signed-off-by: Alan Maguire <>
Reviewed-by: Brendan Higgins <>
Acked-By: Anton Ivanov <>
Signed-off-by: Richard Weinberger <>
Signed-off-by: Paul Gortmaker <>
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
index f25b110d4e70..60bc6a1c7ae6 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>