Add missing rwlock_unlocks in xprt_register (bz 1278149)
Signed-off-by: Steve Dickson <steved@redhat.com>
This commit is contained in:
parent
100b37c1ea
commit
df691fcdee
54
libtirpc-1.0.1-rwlock_unlocks.patch
Normal file
54
libtirpc-1.0.1-rwlock_unlocks.patch
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
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 <mforney@mforney.org>
|
||||||
|
---
|
||||||
|
src/svc.c | 7 ++++---
|
||||||
|
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/svc.c b/src/svc.c
|
||||||
|
index 9c41445..82a9a6c 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);
|
||||||
|
}
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: libtirpc
|
Name: libtirpc
|
||||||
Version: 1.0.1
|
Version: 1.0.1
|
||||||
Release: 0.0%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: Transport Independent RPC Library
|
Summary: Transport Independent RPC Library
|
||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
License: SISSL and BSD
|
License: SISSL and BSD
|
||||||
@ -10,6 +10,8 @@ URL: http://nfsv4.bullopensource.org/
|
|||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
Source0: http://downloads.sourceforge.net/libtirpc/libtirpc-%{version}.tar.bz2
|
Source0: http://downloads.sourceforge.net/libtirpc/libtirpc-%{version}.tar.bz2
|
||||||
|
|
||||||
|
Patch001: libtirpc-1.0.1-rwlock_unlocks.patch
|
||||||
|
|
||||||
BuildRequires: automake, autoconf, libtool, pkgconfig
|
BuildRequires: automake, autoconf, libtool, pkgconfig
|
||||||
BuildRequires: krb5-devel
|
BuildRequires: krb5-devel
|
||||||
|
|
||||||
@ -39,6 +41,8 @@ developing programs which use the tirpc library.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
|
||||||
|
%patch001 -p1
|
||||||
|
|
||||||
# Remove .orig files
|
# Remove .orig files
|
||||||
find . -name "*.orig" | xargs rm -f
|
find . -name "*.orig" | xargs rm -f
|
||||||
|
|
||||||
@ -131,6 +135,9 @@ rm -rf %{buildroot}
|
|||||||
%{_mandir}/*/*
|
%{_mandir}/*/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Nov 4 2015 Steve Dickson <steved@redhat.com> 1.0.1-1
|
||||||
|
- Add missing rwlock_unlocks in xprt_register (bz 1278149)
|
||||||
|
|
||||||
* Fri Oct 30 2015 Steve Dickson <steved@redhat.com> 1.0.1-0.1
|
* Fri Oct 30 2015 Steve Dickson <steved@redhat.com> 1.0.1-0.1
|
||||||
- Updated to latest upstream release: libtirpc-1-0-1
|
- Updated to latest upstream release: libtirpc-1-0-1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user