[Glibc-bsd-commits] r3161 - trunk/zfsutils/debian/patches

Tuco Xyz tuco-guest at alioth.debian.org
Fri Aug 13 22:24:54 UTC 2010


Author: tuco-guest
Date: 2010-08-13 22:24:54 +0000 (Fri, 13 Aug 2010)
New Revision: 3161

Added:
   trunk/zfsutils/debian/patches/09_xdr_control.diff
Modified:
   trunk/zfsutils/debian/patches/01_glibc_kludge.diff
   trunk/zfsutils/debian/patches/series
Log:

Proper fix for xdr_control problem: remove the sanity check. Using a stub makes the sanity check fail. This is one of the causes that break zpool import.



Modified: trunk/zfsutils/debian/patches/01_glibc_kludge.diff
===================================================================
--- trunk/zfsutils/debian/patches/01_glibc_kludge.diff	2010-08-12 17:01:03 UTC (rev 3160)
+++ trunk/zfsutils/debian/patches/01_glibc_kludge.diff	2010-08-13 22:24:54 UTC (rev 3161)
@@ -23,39 +23,3 @@
  	build_iovec(&iov, &iovlen, "fspath", __DECONST(char *, dir),
  	    (size_t)-1);
  	build_iovec(&iov, &iovlen, "from", __DECONST(char *, spec), (size_t)-1);
-diff -ur -x debian a/sys/cddl/compat/opensolaris/rpc/xdr.h b/sys/cddl/compat/opensolaris/rpc/xdr.h
---- a/sys/cddl/compat/opensolaris/rpc/xdr.h	2009-08-19 20:08:58.000000000 -0400
-+++ b/sys/cddl/compat/opensolaris/rpc/xdr.h	2010-07-27 20:07:02.661041790 -0400
-@@ -32,7 +32,31 @@
- 
- #include_next <rpc/xdr.h>
- 
--#ifndef _KERNEL
-+/* Copied from the FreeBSD version of <rpc/xdr.h> */
-+#ifdef __GLIBC__
-+/*
-+ * These are XDR control operators
-+ */
-+
-+#define	XDR_GET_BYTES_AVAIL 	1
-+#define	XDR_PEEK		2
-+#define	XDR_SKIPBYTES		3
-+
-+struct xdr_bytesrec {
-+	bool_t xc_is_last_record;
-+	size_t xc_num_avail;
-+};
-+
-+typedef struct xdr_bytesrec xdr_bytesrec;
-+#endif
-+
-+#if defined(__GLIBC__)
-+
-+/* GNU libc doesn't implement XDR control method */
-+#define	XDR_CONTROL(xdrs, req, op)	(1)
-+#define xdr_control(xdrs, req, op)	XDR_CONTROL(xdrs, req, op)
-+
-+#elif !defined(_KERNEL)
- 
- #include <assert.h>
- 

Added: trunk/zfsutils/debian/patches/09_xdr_control.diff
===================================================================
--- trunk/zfsutils/debian/patches/09_xdr_control.diff	                        (rev 0)
+++ trunk/zfsutils/debian/patches/09_xdr_control.diff	2010-08-13 22:24:54 UTC (rev 3161)
@@ -0,0 +1,49 @@
+diff -ur a/sys/cddl/compat/opensolaris/rpc/xdr.h b/sys/cddl/compat/opensolaris/rpc/xdr.h
+--- a/sys/cddl/compat/opensolaris/rpc/xdr.h	2010-08-13 15:55:24.000000000 -0400
++++ b/sys/cddl/compat/opensolaris/rpc/xdr.h	2010-08-13 15:57:13.000000000 -0400
+@@ -32,7 +32,7 @@
+ 
+ #include_next <rpc/xdr.h>
+ 
+-#ifndef _KERNEL
++#if !defined(_KERNEL) && defined(__FreeBSD__)
+ 
+ #include <assert.h>
+ 
+@@ -65,6 +65,6 @@
+ 	    xdrmem_control((xdrs), (req), (op)) :			\
+ 	    (*(xdrs)->x_ops->x_control)(xdrs, req, op))   
+ 
+-#endif	/* !_KERNEL */
++#endif	/* !_KERNEL && __FreeBSD__ */
+ 
+ #endif	/* !_OPENSOLARIS_RPC_XDR_H_ */
+diff -ur a/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c b/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c
+--- a/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c	2010-08-13 15:56:20.000000000 -0400
++++ b/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c	2010-08-13 15:56:44.000000000 -0400
+@@ -3191,8 +3191,6 @@
+ 		return (nvs_xdr_nvp_op(nvs, nvp));
+ 	}
+ 	case NVS_OP_DECODE: {
+-		struct xdr_bytesrec bytesrec;
+-
+ 		/* get the encode and decode size */
+ 		if (!xdr_int(xdr, &encode_len) || !xdr_int(xdr, &decode_len))
+ 			return (EFAULT);
+@@ -3202,12 +3200,16 @@
+ 		if (*size == 0)
+ 			return (0);
+ 
++#if defined(__sun) || defined(__FreeBSD__)
++		struct xdr_bytesrec bytesrec;
++
+ 		/* sanity check the size parameter */
+ 		if (!xdr_control(xdr, XDR_GET_BYTES_AVAIL, &bytesrec))
+ 			return (EFAULT);
+ 
+ 		if (*size > NVS_XDR_MAX_LEN(bytesrec.xc_num_avail))
+ 			return (EFAULT);
++#endif
+ 		break;
+ 	}
+ 

Modified: trunk/zfsutils/debian/patches/series
===================================================================
--- trunk/zfsutils/debian/patches/series	2010-08-12 17:01:03 UTC (rev 3160)
+++ trunk/zfsutils/debian/patches/series	2010-08-13 22:24:54 UTC (rev 3161)
@@ -6,3 +6,4 @@
 06_mountd.diff
 07_manpages.diff
 08_libbsd.diff
+09_xdr_control.diff




More information about the Glibc-bsd-commits mailing list