summaryrefslogtreecommitdiffstats
path: root/patches/unfs3-0.9.22
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2014-05-01 15:20:54 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2014-05-01 15:46:24 +0200
commitb003a9494300540d203400148e394ad5070934ff (patch)
tree492ff6a858db3b01a3515141f6d6fde844962636 /patches/unfs3-0.9.22
parent2ee88db579fe2cd11dee9f32be3ec52bf5e01b40 (diff)
downloadptxdist-b003a9494300540d203400148e394ad5070934ff.tar.gz
ptxdist-b003a9494300540d203400148e394ad5070934ff.tar.xz
host-unfs3: add upstream patch for 64-bit Linux host systems
This should fix "unable to send RPC reply" errors. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches/unfs3-0.9.22')
-rw-r--r--patches/unfs3-0.9.22/0001-HACK-use-the-environment-variable-UNFS_BASE-as-root-.patch4
-rw-r--r--patches/unfs3-0.9.22/0003-64-bit-fixes-don-t-assume-that-long-is-the-same-size.patch120
l---------patches/unfs3-0.9.22/autogen.sh1
-rw-r--r--patches/unfs3-0.9.22/series3
4 files changed, 125 insertions, 3 deletions
diff --git a/patches/unfs3-0.9.22/0001-HACK-use-the-environment-variable-UNFS_BASE-as-root-.patch b/patches/unfs3-0.9.22/0001-HACK-use-the-environment-variable-UNFS_BASE-as-root-.patch
index eae37a29c..fd10eb65b 100644
--- a/patches/unfs3-0.9.22/0001-HACK-use-the-environment-variable-UNFS_BASE-as-root-.patch
+++ b/patches/unfs3-0.9.22/0001-HACK-use-the-environment-variable-UNFS_BASE-as-root-.patch
@@ -5,8 +5,8 @@ Subject: [PATCH] HACK: use the environment variable UNFS_BASE as root
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
- backend_unix.h | 3 ++-
- readdir.c | 16 ++++++++++++++++
+ backend_unix.h | 3 ++-
+ readdir.c | 16 ++++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/backend_unix.h b/backend_unix.h
diff --git a/patches/unfs3-0.9.22/0003-64-bit-fixes-don-t-assume-that-long-is-the-same-size.patch b/patches/unfs3-0.9.22/0003-64-bit-fixes-don-t-assume-that-long-is-the-same-size.patch
new file mode 100644
index 000000000..c4087c8f0
--- /dev/null
+++ b/patches/unfs3-0.9.22/0003-64-bit-fixes-don-t-assume-that-long-is-the-same-size.patch
@@ -0,0 +1,120 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Thu, 1 May 2014 15:12:56 +0200
+Subject: [PATCH] 64-bit fixes: don't assume that long is the same size as
+ int32.
+
+xdr_(u)int32 used to call xdr_(u)long, which worked well enough on
+32-bit systems where sizeof(int32) == sizeof(long). For 64-bit Linux
+systems where sizeof(long) > sizeof(int32), this leads to a few
+problems. This commit fixes this by using the xdr_(u)int32(_t) methods
+where present, and fall back to xdr_(u)int when it's the only
+option. This should solve the "Unable to send RPC reply" problem when a
+NFS client is trying to create new files with a 64-bit linux server.
+
+Upstream revison r488
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ configure.ac | 4 +++-
+ nfs.h | 8 --------
+ xdr.c | 37 +++++++++++++++++++++++++++++++------
+ 3 files changed, 34 insertions(+), 15 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 023b296..cf1d9d1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -22,7 +22,9 @@ AC_CHECK_TYPES(int64,,,[#include <sys/inttypes.h>])
+ AC_CHECK_TYPES(uint64,,,[#include <sys/inttypes.h>])
+ AC_CHECK_MEMBERS([struct stat.st_gen],,,[#include <sys/stat.h>])
+ AC_CHECK_MEMBERS([struct __rpc_svcxprt.xp_fd],,,[#include <rpc/rpc.h>])
+-AC_CHECK_FUNCS(xdr_long xdr_int32 xdr_u_long xdr_uint32)
++AC_CHECK_FUNCS(xdr_int xdr_u_int)
++AC_CHECK_FUNCS(xdr_int32 xdr_int32_t)
++AC_CHECK_FUNCS(xdr_uint32 xdr_uint32_t xdr_u_int32_t)
+ AC_CHECK_FUNCS(xdr_uint64 xdr_uint64_t xdr_u_int64_t)
+ AC_CHECK_FUNCS(statvfs)
+ AC_CHECK_FUNCS(seteuid setegid)
+diff --git a/nfs.h b/nfs.h
+index 63041fa..b3a94ed 100644
+--- a/nfs.h
++++ b/nfs.h
+@@ -54,20 +54,12 @@ typedef int64_t int64;
+ #endif
+
+ #if HAVE_UINT32 == 0
+-#if HAVE_XDR_U_LONG == 1
+-typedef u_long uint32;
+-#else
+ typedef uint32_t uint32;
+ #endif
+-#endif
+
+ #if HAVE_INT32 == 0
+-#if HAVE_XDR_LONG == 1
+-typedef long int32;
+-#else
+ typedef int32_t int32;
+ #endif
+-#endif
+
+ typedef char *filename3;
+
+diff --git a/xdr.c b/xdr.c
+index 21e5ea7..6aa100c 100644
+--- a/xdr.c
++++ b/xdr.c
+@@ -192,22 +192,47 @@ bool_t xdr_uint64(XDR * xdrs, uint64 * objp)
+ #endif
+ #endif
+
+-#if HAVE_XDR_UINT32 == 0 && HAVE_XDR_U_LONG == 1
++#ifndef HAVE_XDR_UINT32
++# ifdef HAVE_XDR_UINT32_T
+ bool_t xdr_uint32(XDR * xdrs, uint32 * objp)
+ {
+- if (!xdr_u_long(xdrs, objp))
+- return FALSE;
++ if (!xdr_uint32_t(xdrs, objp))
++ return FALSE;
++ return TRUE;
++}
++# elif defined(HAVE_XDR_U_INT32_T)
++bool_t xdr_uint32(XDR * xdrs, uint32 * objp)
++{
++ if (!xdr_u_int32_t(xdrs, objp))
++ return FALSE;
++ return TRUE;
++}
++# elif defined(HAVE_XDR_U_INT)
++bool_t xdr_uint32(XDR * xdrs, uint32 * objp)
++{
++ if (!xdr_u_int(xdrs, objp))
++ return FALSE;
+ return TRUE;
+ }
++# endif
+ #endif
+
+-#if HAVE_XDR_INT32 == 0 && HAVE_XDR_LONG == 1
++#ifndef HAVE_XDR_INT32
++# ifdef HAVE_XDR_INT32_T
+ bool_t xdr_int32(XDR * xdrs, int32 * objp)
+ {
+- if (!xdr_long(xdrs, objp))
+- return FALSE;
++ if (!xdr_int32_t(xdrs, objp))
++ return FALSE;
++ return TRUE;
++}
++# elif defined(HAVE_XDR_INT)
++bool_t xdr_int32(XDR * xdrs, int32 * objp)
++{
++ if (!xdr_int(xdrs, objp))
++ return FALSE;
+ return TRUE;
+ }
++# endif
+ #endif
+
+ bool_t xdr_filename3(XDR * xdrs, filename3 * objp)
diff --git a/patches/unfs3-0.9.22/autogen.sh b/patches/unfs3-0.9.22/autogen.sh
new file mode 120000
index 000000000..9f8a4cb7d
--- /dev/null
+++ b/patches/unfs3-0.9.22/autogen.sh
@@ -0,0 +1 @@
+../autogen.sh \ No newline at end of file
diff --git a/patches/unfs3-0.9.22/series b/patches/unfs3-0.9.22/series
index b6fcb381f..ed7d9b998 100644
--- a/patches/unfs3-0.9.22/series
+++ b/patches/unfs3-0.9.22/series
@@ -2,4 +2,5 @@
#tag:base --start-number 1
0001-HACK-use-the-environment-variable-UNFS_BASE-as-root-.patch
0002-fix-unfs3-build-with-recent-versions-of-flex.patch
-# d6aa3d6dc84fdde0ed4ec62b8f23a731 - git-ptx-patches magic
+0003-64-bit-fixes-don-t-assume-that-long-is-the-same-size.patch
+# cbc0b51ceb8d5bce30bc87ed263015da - git-ptx-patches magic