diff options
author | kib <kib@FreeBSD.org> | 2009-07-14 22:54:29 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-07-14 22:54:29 +0000 |
commit | 50c96d8f042d19384144c442c22ee0e0a7314ca9 (patch) | |
tree | a0fd9946a1d3f491996b7e401f7dd0872d11817a /sys/rpc | |
parent | c7441b67e68fb8dbdec2ca853f77acf72e7cf0e9 (diff) | |
download | FreeBSD-src-50c96d8f042d19384144c442c22ee0e0a7314ca9.zip FreeBSD-src-50c96d8f042d19384144c442c22ee0e0a7314ca9.tar.gz |
Use PBDRY flag for msleep(9) in NFS and NLM when sleeping thread owns
kernel resources that block other threads, like vnode locks. The SIGSTOP
sent to such thread (process, rather) shall not stop it until thread
releases the resources.
Tested by: pho
Reviewed by: jhb
Approved by: re (kensmith)
Diffstat (limited to 'sys/rpc')
-rw-r--r-- | sys/rpc/clnt_rc.c | 3 | ||||
-rw-r--r-- | sys/rpc/clnt_vc.c | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sys/rpc/clnt_rc.c b/sys/rpc/clnt_rc.c index 5e80d05..217608c 100644 --- a/sys/rpc/clnt_rc.c +++ b/sys/rpc/clnt_rc.c @@ -264,7 +264,8 @@ clnt_reconnect_call( stat = clnt_reconnect_connect(cl); if (stat == RPC_SYSTEMERROR) { error = tsleep(&fake_wchan, - rc->rc_intr ? PCATCH : 0, "rpccon", hz); + rc->rc_intr ? PCATCH | PBDRY : 0, "rpccon", + hz); if (error == EINTR || error == ERESTART) return (RPC_INTR); tries++; diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c index 4e732f2..3f15c43 100644 --- a/sys/rpc/clnt_vc.c +++ b/sys/rpc/clnt_vc.c @@ -196,7 +196,7 @@ clnt_vc_create( while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) { error = msleep(&so->so_timeo, SOCK_MTX(so), - PSOCK | PCATCH, "connec", 0); + PSOCK | PCATCH | PBDRY, "connec", 0); if (error) { if (error == EINTR || error == ERESTART) interrupted = 1; @@ -477,6 +477,7 @@ call_again: errp->re_errno = error; switch (error) { case EINTR: + case ERESTART: stat = RPC_INTR; break; case EWOULDBLOCK: @@ -709,7 +710,7 @@ clnt_vc_control(CLIENT *cl, u_int request, void *info) case CLSET_INTERRUPTIBLE: if (*(int *) info) - ct->ct_waitflag = PCATCH; + ct->ct_waitflag = PCATCH | PBDRY; else ct->ct_waitflag = 0; break; |