* The recent thread sunrpc change breaks statd
@ 2001-05-06 20:35 H . J . Lu
2001-05-06 20:48 ` PATCH: " H . J . Lu
0 siblings, 1 reply; 2+ messages in thread
From: H . J . Lu @ 2001-05-06 20:35 UTC (permalink / raw)
To: GNU C Library
The recent sunrpc change breaks statd which is the part of nfs-utils.
statd is a special rpc daemon. It has its own vesion of svc_run and
uses svc_fdset. The problem is in sunrpc/rpc_thread.c:
fd_set *
__rpc_thread_svc_fdset (void)
{
struct rpc_thread_variables *tvp;
tvp = __rpc_thread_variables ();
if (tvp == &rpc_default)
return &svc_fdset;
return &tvp->svc_fdset_s;
}
in statd. But __rpc_thread_variables () doesn't return &rpc_default.
As the result, __rpc_thread_svc_fdset () doesn't return &svc_fdset
for this special single thread rpc daemon.
The code in sunrpc/rpc_thread.c doesn't look right to me, at least
for non-threaded applications. I will try to come up with a patch
next week.
H.J.
^ permalink raw reply [flat|nested] 2+ messages in thread
* PATCH: The recent thread sunrpc change breaks statd
2001-05-06 20:35 The recent thread sunrpc change breaks statd H . J . Lu
@ 2001-05-06 20:48 ` H . J . Lu
0 siblings, 0 replies; 2+ messages in thread
From: H . J . Lu @ 2001-05-06 20:48 UTC (permalink / raw)
To: GNU C Library
On Sun, May 06, 2001 at 08:35:52PM -0700, H . J . Lu wrote:
> The recent sunrpc change breaks statd which is the part of nfs-utils.
> statd is a special rpc daemon. It has its own vesion of svc_run and
> uses svc_fdset. The problem is in sunrpc/rpc_thread.c:
>
> fd_set *
> __rpc_thread_svc_fdset (void)
> {
> struct rpc_thread_variables *tvp;
>
> tvp = __rpc_thread_variables ();
> if (tvp == &rpc_default)
> return &svc_fdset;
> return &tvp->svc_fdset_s;
> }
>
> in statd. But __rpc_thread_variables () doesn't return &rpc_default.
> As the result, __rpc_thread_svc_fdset () doesn't return &svc_fdset
> for this special single thread rpc daemon.
>
> The code in sunrpc/rpc_thread.c doesn't look right to me, at least
> for non-threaded applications. I will try to come up with a patch
> next week.
>
>
Here is a patch.
H.J.
----
2001-05-06 H.J. Lu <hjl@gnu.org>
* sunrpc/rpc_thread.c (__rpc_thread_destroy): Also check
__libc_tsd_RPC_VARS_data for non-threaded applications.
(__rpc_thread_svc_fdset): Likewise.
(__rpc_thread_createerr): Likewise.
(__rpc_thread_svc_pollfd): Likewise.
(__rpc_thread_svc_max_pollfd): Likewise.
Index: sunrpc/rpc_thread.c
===================================================================
RCS file: /work/cvs/gnu/glibc/sunrpc/rpc_thread.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 rpc_thread.c
--- sunrpc/rpc_thread.c 2001/04/01 03:53:29 1.1.1.2
+++ sunrpc/rpc_thread.c 2001/05/07 03:42:15
@@ -26,7 +26,9 @@ __rpc_thread_destroy (void)
{
struct rpc_thread_variables *tvp = __rpc_thread_variables();
- if (tvp != NULL && tvp != &rpc_default) {
+ if (tvp != NULL
+ && tvp != __libc_tsd_RPC_VARS_data
+ && tvp != &rpc_default) {
__rpc_thread_svc_cleanup ();
__rpc_thread_clnt_cleanup ();
__rpc_thread_key_cleanup ();
@@ -88,7 +90,7 @@ __rpc_thread_svc_fdset (void)
struct rpc_thread_variables *tvp;
tvp = __rpc_thread_variables ();
- if (tvp == &rpc_default)
+ if (tvp == __libc_tsd_RPC_VARS_data || tvp == &rpc_default)
return &svc_fdset;
return &tvp->svc_fdset_s;
}
@@ -99,7 +101,7 @@ __rpc_thread_createerr (void)
struct rpc_thread_variables *tvp;
tvp = __rpc_thread_variables ();
- if (tvp == &rpc_default)
+ if (tvp == __libc_tsd_RPC_VARS_data || tvp == &rpc_default)
return &rpc_createerr;
return &tvp->rpc_createerr_s;
}
@@ -110,7 +112,7 @@ __rpc_thread_svc_pollfd (void)
struct rpc_thread_variables *tvp;
tvp = __rpc_thread_variables ();
- if (tvp == &rpc_default)
+ if (tvp == __libc_tsd_RPC_VARS_data || tvp == &rpc_default)
return &svc_pollfd;
return &tvp->svc_pollfd_s;
}
@@ -121,7 +123,7 @@ __rpc_thread_svc_max_pollfd (void)
struct rpc_thread_variables *tvp;
tvp = __rpc_thread_variables ();
- if (tvp == &rpc_default)
+ if (tvp == __libc_tsd_RPC_VARS_data || tvp == &rpc_default)
return &svc_max_pollfd;
return &tvp->svc_max_pollfd_s;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-05-06 20:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-06 20:35 The recent thread sunrpc change breaks statd H . J . Lu
2001-05-06 20:48 ` PATCH: " H . J . Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).