Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Aug 2011 18:09:17 +0000 (UTC)
From:      Artem Belevich <art@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r225234 - head/sys/rpc
Message-ID:  <201108281809.p7SI9H6q062008@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108281809.p7SI9H6q062008>