Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Sep 2018 05:18:20 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r338923 - stable/11/sys/dev/random
Message-ID:  <201809250518.w8P5IKdH084320@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Tue Sep 25 05:18:20 2018
New Revision: 338923
URL: https://svnweb.freebsd.org/changeset/base/338923

Log:
  Partial MFC of r338542:
  
  random(4): Squash non-error timeout code from tsleep(9).
  
  PR:		231181
  Submitted by:	cem
  Reported by:	lev
  Reviewed by:	vangyzen, markm, delphij
  Approved by:	secteam (delphij)
  Differential Revision:	https://reviews.freebsd.org/D17049

Modified:
  stable/11/sys/dev/random/randomdev.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/random/randomdev.c
==============================================================================
--- stable/11/sys/dev/random/randomdev.c	Tue Sep 25 02:34:28 2018	(r338922)
+++ stable/11/sys/dev/random/randomdev.c	Tue Sep 25 05:18:20 2018	(r338923)
@@ -149,6 +149,10 @@ READ_RANDOM_UIO(struct uio *uio, bool nonblock)
 		error = tsleep(&random_alg_context, PCATCH, "randseed", hz/10);
 		if (error == ERESTART || error == EINTR)
 			break;
+		/* Squash tsleep timeout condition */
+		if (error == EWOULDBLOCK)
+			error = 0;
+		KASSERT(error == 0, ("unexpected tsleep error %d", error));
 	}
 	if (error == 0) {
 		read_rate_increment((uio->uio_resid + sizeof(uint32_t))/sizeof(uint32_t));



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