diff options
author | Artem Belevich <art@FreeBSD.org> | 2011-08-28 18:09:17 +0000 |
---|---|---|
committer | Artem Belevich <art@FreeBSD.org> | 2011-08-28 18:09:17 +0000 |
commit | fa3db771d2715fb61e3b9d40b770060fc8940f26 (patch) | |
tree | 3c2b0762cc6d236e0e5563177975568c3951bbb8 /sys/rpc/clnt_dg.c | |
parent | c4a2a390049bd7f1695ff2aeab0d2b4e981c0be4 (diff) | |
download | src-fa3db771d2715fb61e3b9d40b770060fc8940f26.tar.gz src-fa3db771d2715fb61e3b9d40b770060fc8940f26.zip |
Make sure RPC calls over UDP return RPC_INTR status is the process has
been interrupted in a restartable syscall. Otherwise we could end up
in an (almost) endless loop in clnt_reconnect_call().
PR: kern/160198
Reviewed by: rmacklem
Approved by: re (kib), avg (mentor)
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=225234
Diffstat (limited to 'sys/rpc/clnt_dg.c')
-rw-r--r-- | sys/rpc/clnt_dg.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/rpc/clnt_dg.c b/sys/rpc/clnt_dg.c index a412c084fb95..8a69bf4e5b19 100644 --- a/sys/rpc/clnt_dg.c +++ b/sys/rpc/clnt_dg.c @@ -467,7 +467,10 @@ send_again: cu->cu_waitflag, "rpccwnd", 0); if (error) { errp->re_errno = error; - errp->re_status = stat = RPC_CANTSEND; + if (error == EINTR || error == ERESTART) + errp->re_status = stat = RPC_INTR; + else + errp->re_status = stat = RPC_CANTSEND; goto out; } } @@ -636,7 +639,7 @@ get_reply: */ if (error != EWOULDBLOCK) { errp->re_errno = error; - if (error == EINTR) + if (error == EINTR || error == ERESTART) errp->re_status = stat = RPC_INTR; else errp->re_status = stat = RPC_CANTRECV; |