svn commit: r225234 - head/sys/rpc

Artem Belevich art at FreeBSD.org
Sun Aug 28 18:09:17 UTC 2011


Author: art
Date: Sun Aug 28 18:09:17 2011
New Revision: 225234
URL: http://svn.freebsd.org/changeset/base/225234

Log:
  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

Modified:
  head/sys/rpc/clnt_dg.c

Modified: head/sys/rpc/clnt_dg.c
==============================================================================
--- head/sys/rpc/clnt_dg.c	Sun Aug 28 16:11:24 2011	(r225233)
+++ head/sys/rpc/clnt_dg.c	Sun Aug 28 18:09:17 2011	(r225234)
@@ -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;


More information about the svn-src-head mailing list