summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity')
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Fix-include-order-between-config.h-and-stat.h.patch156
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.1.bb1
2 files changed, 157 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Fix-include-order-between-config.h-and-stat.h.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Fix-include-order-between-config.h-and-stat.h.patch
new file mode 100644
index 0000000000..7b0f93535f
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Fix-include-order-between-config.h-and-stat.h.patch
@@ -0,0 +1,156 @@
1From 2fbc62e2a13fc22b6ae4910e295a2c10fb790486 Mon Sep 17 00:00:00 2001
2From: Zoltan Karcagi <zkr7432@gmail.com>
3Date: Mon, 12 Aug 2019 13:27:16 -0400
4Subject: [PATCH] Fix include order between config.h and stat.h
5
6At least on Arch linux ARM, the definition of struct stat in stat.h depends
7on __USE_FILE_OFFSET64. This symbol comes from config.h when defined,
8therefore config.h must always be included before stat.h. Fix all
9occurrences where the order is wrong by moving config.h to the top.
10
11This fixes the client side error "Stale file handle" when mounting from
12a server running Arch Linux ARM.
13
14Signed-off-by: Zoltan Karcagi <zkr7432@gmail.com>
15Signed-off-by: Steve Dickson <steved@redhat.com>
16
17Upstream-Status: Backport
18[http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=2fbc62e2a13fc22b6ae4910e295a2c10fb790486]
19
20Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
21---
22 support/misc/nfsd_path.c | 5 ++++-
23 support/misc/xstat.c | 5 ++++-
24 support/nfs/conffile.c | 8 +++++++-
25 utils/blkmapd/device-discovery.c | 8 ++++----
26 utils/idmapd/idmapd.c | 8 ++++----
27 5 files changed, 23 insertions(+), 11 deletions(-)
28
29diff --git a/support/misc/nfsd_path.c b/support/misc/nfsd_path.c
30index 84e4802..f078a66 100644
31--- a/support/misc/nfsd_path.c
32+++ b/support/misc/nfsd_path.c
33@@ -1,3 +1,7 @@
34+#ifdef HAVE_CONFIG_H
35+#include <config.h>
36+#endif
37+
38 #include <errno.h>
39 #include <sys/types.h>
40 #include <sys/stat.h>
41@@ -5,7 +9,6 @@
42 #include <stdlib.h>
43 #include <unistd.h>
44
45-#include "config.h"
46 #include "conffile.h"
47 #include "xmalloc.h"
48 #include "xlog.h"
49diff --git a/support/misc/xstat.c b/support/misc/xstat.c
50index fa04788..4c997ee 100644
51--- a/support/misc/xstat.c
52+++ b/support/misc/xstat.c
53@@ -1,3 +1,7 @@
54+#ifdef HAVE_CONFIG_H
55+#include <config.h>
56+#endif
57+
58 #include <errno.h>
59 #include <sys/types.h>
60 #include <fcntl.h>
61@@ -5,7 +9,6 @@
62 #include <sys/sysmacros.h>
63 #include <unistd.h>
64
65-#include "config.h"
66 #include "xstat.h"
67
68 #ifdef HAVE_FSTATAT
69diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
70index b6400be..6ba8a35 100644
71--- a/support/nfs/conffile.c
72+++ b/support/nfs/conffile.c
73@@ -500,7 +500,7 @@ conf_readfile(const char *path)
74
75 if ((stat (path, &sb) == 0) || (errno != ENOENT)) {
76 char *new_conf_addr = NULL;
77- size_t sz = sb.st_size;
78+ off_t sz;
79 int fd = open (path, O_RDONLY, 0);
80
81 if (fd == -1) {
82@@ -517,6 +517,11 @@ conf_readfile(const char *path)
83
84 /* only after we have the lock, check the file size ready to read it */
85 sz = lseek(fd, 0, SEEK_END);
86+ if (sz < 0) {
87+ xlog_warn("conf_readfile: unable to determine file size: %s",
88+ strerror(errno));
89+ goto fail;
90+ }
91 lseek(fd, 0, SEEK_SET);
92
93 new_conf_addr = malloc(sz+1);
94@@ -2162,6 +2167,7 @@ conf_write(const char *filename, const char *section, const char *arg,
95 ret = 0;
96
97 cleanup:
98+ flush_outqueue(&inqueue, NULL);
99 flush_outqueue(&outqueue, NULL);
100
101 if (buff)
102diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c
103index e811703..f5f9b10 100644
104--- a/utils/blkmapd/device-discovery.c
105+++ b/utils/blkmapd/device-discovery.c
106@@ -26,6 +26,10 @@
107 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
108 */
109
110+#ifdef HAVE_CONFIG_H
111+#include "config.h"
112+#endif /* HAVE_CONFIG_H */
113+
114 #include <sys/sysmacros.h>
115 #include <sys/types.h>
116 #include <sys/stat.h>
117@@ -51,10 +55,6 @@
118 #include <errno.h>
119 #include <libdevmapper.h>
120
121-#ifdef HAVE_CONFIG_H
122-#include "config.h"
123-#endif /* HAVE_CONFIG_H */
124-
125 #include "device-discovery.h"
126 #include "xcommon.h"
127 #include "nfslib.h"
128diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c
129index 62e37b8..267acea 100644
130--- a/utils/idmapd/idmapd.c
131+++ b/utils/idmapd/idmapd.c
132@@ -34,6 +34,10 @@
133 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
134 */
135
136+#ifdef HAVE_CONFIG_H
137+#include "config.h"
138+#endif /* HAVE_CONFIG_H */
139+
140 #include <sys/types.h>
141 #include <sys/time.h>
142 #include <sys/inotify.h>
143@@ -62,10 +66,6 @@
144 #include <libgen.h>
145 #include <nfsidmap.h>
146
147-#ifdef HAVE_CONFIG_H
148-#include "config.h"
149-#endif /* HAVE_CONFIG_H */
150-
151 #include "xlog.h"
152 #include "conffile.h"
153 #include "queue.h"
154--
1552.7.4
156
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.1.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.1.bb
index 8b673c8f5f..7e80354e4e 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.1.bb
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.1.bb
@@ -32,6 +32,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x
32 file://clang-format-string.patch \ 32 file://clang-format-string.patch \
33 file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \ 33 file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \
34 file://0001-Don-t-build-tools-with-CC_FOR_BUILD.patch \ 34 file://0001-Don-t-build-tools-with-CC_FOR_BUILD.patch \
35 file://0001-Fix-include-order-between-config.h-and-stat.h.patch \
35" 36"
36SRC_URI_append_libc-glibc = " file://0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch" 37SRC_URI_append_libc-glibc = " file://0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch"
37SRC_URI_append_libc-musl = " file://nfs-utils-musl-res_querydomain.patch" 38SRC_URI_append_libc-musl = " file://nfs-utils-musl-res_querydomain.patch"