svn commit: r225384 - stable/8/sys/rpc

Artem Belevich art at FreeBSD.org
Mon Sep 5 06:54:14 UTC 2011


Author: art
Date: Mon Sep  5 06:54:13 2011
New Revision: 225384
URL: http://svn.freebsd.org/changeset/base/225384

Log:
  MFC r225234:
  
  Make sure RPC calls over UDP return RPC_INTR status if 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: avg (mentor)

Modified:
  stable/8/sys/rpc/clnt_dg.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/rpc/clnt_dg.c
==============================================================================
--- stable/8/sys/rpc/clnt_dg.c	Mon Sep  5 06:11:17 2011	(r225383)
+++ stable/8/sys/rpc/clnt_dg.c	Mon Sep  5 06:54:13 2011	(r225384)
@@ -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-stable mailing list