Date: Friday, November 6, 2015 @ 19:31:16 Author: andyrtr Revision: 250150
upgpkg: libtirpc 1.0.1-2 add an upstream commit to make it work with rpcbind again Added: libtirpc/trunk/add_missing_rwlock_unlocks_in_xprt_register.diff Modified: libtirpc/trunk/PKGBUILD --------------------------------------------------+ PKGBUILD | 14 +++- add_missing_rwlock_unlocks_in_xprt_register.diff | 61 +++++++++++++++++++++ 2 files changed, 72 insertions(+), 3 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2015-11-06 16:48:41 UTC (rev 250149) +++ PKGBUILD 2015-11-06 18:31:16 UTC (rev 250150) @@ -4,7 +4,7 @@ pkgname=libtirpc pkgver=1.0.1 -pkgrel=1 +pkgrel=2 pkgdesc="Transport Independent RPC library (SunRPC replacement)" arch=('i686' 'x86_64') url="http://libtirpc.sourceforge.net/" @@ -12,9 +12,17 @@ depends=('krb5') backup=('etc/netconfig') # git tree: git://linux-nfs.org/~steved/libtirpc -source=(http://downloads.sourceforge.net/sourceforge/libtirpc/${pkgname}-${pkgver}.tar.bz2) -sha1sums=('8da1636f98b5909c0d587e7534bc1e91f5c1a970') +source=(http://downloads.sourceforge.net/sourceforge/libtirpc/${pkgname}-${pkgver}.tar.bz2 + add_missing_rwlock_unlocks_in_xprt_register.diff) +sha1sums=('8da1636f98b5909c0d587e7534bc1e91f5c1a970' + 'c451b0eb527098c0d9e308e4978866b7aaaf688e') +prepare() { + cd ${pkgname}-${pkgver} + # upstream post release fix to properly work with rpcbind + patch -Np1 -i ../add_missing_rwlock_unlocks_in_xprt_register.diff +} + build() { cd ${pkgname}-${pkgver} ./configure --prefix=/usr --sysconf=/etc Added: add_missing_rwlock_unlocks_in_xprt_register.diff =================================================================== --- add_missing_rwlock_unlocks_in_xprt_register.diff (rev 0) +++ add_missing_rwlock_unlocks_in_xprt_register.diff 2015-11-06 18:31:16 UTC (rev 250150) @@ -0,0 +1,61 @@ +From 4f1503e84b2f7bd229a097335e52fb8203f5bb0b Mon Sep 17 00:00:00 2001 +From: Michael Forney <mfor...@mforney.org> +Date: Wed, 4 Nov 2015 13:58:06 -0500 +Subject: [PATCH] Add missing rwlock_unlocks in xprt_register + +It looks like in b2c9430f46c4ac848957fb8adaac176a3f6ac03f when svc_run +switched to poll, an early return was added, but the rwlock was not +unlocked. + +I observed that rpcbind built against libtirpc-1.0.1 would handle only +one request before hanging, and tracked it down to a missing +rwlock_unlock here. + +Fixes: b2c9430f46c4 ('Use poll() instead of select() in svc_run()') +Signed-off-by: Michael Forney <mfor...@mforney.org> +Signed-off-by: Steve Dickson <ste...@redhat.com> +--- + src/svc.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/svc.c b/src/svc.c +index 9c41445..b59467b 100644 +--- a/src/svc.c ++++ b/src/svc.c +@@ -99,7 +99,7 @@ xprt_register (xprt) + { + __svc_xports = (SVCXPRT **) calloc (_rpc_dtablesize(), sizeof (SVCXPRT *)); + if (__svc_xports == NULL) +- return; ++ goto unlock; + } + if (sock < _rpc_dtablesize()) + { +@@ -120,14 +120,14 @@ xprt_register (xprt) + svc_pollfd[i].fd = sock; + svc_pollfd[i].events = (POLLIN | POLLPRI | + POLLRDNORM | POLLRDBAND); +- return; ++ goto unlock; + } + + new_svc_pollfd = (struct pollfd *) realloc (svc_pollfd, + sizeof (struct pollfd) + * (svc_max_pollfd + 1)); + if (new_svc_pollfd == NULL) /* Out of memory */ +- return; ++ goto unlock; + svc_pollfd = new_svc_pollfd; + ++svc_max_pollfd; + +@@ -135,6 +135,7 @@ xprt_register (xprt) + svc_pollfd[svc_max_pollfd - 1].events = (POLLIN | POLLPRI | + POLLRDNORM | POLLRDBAND); + } ++unlock: + rwlock_unlock (&svc_fd_lock); + } + +-- +1.8.2.1 +