From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754124AbbETSpz (ORCPT ); Wed, 20 May 2015 14:45:55 -0400 Received: from helcar.hengli.com.au ([209.40.204.226]:39334 "EHLO helcar.hengli.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753359AbbETSpt (ORCPT ); Wed, 20 May 2015 14:45:49 -0400 Date: Thu, 21 May 2015 02:45:35 +0800 From: Herbert Xu To: Stephan Mueller Cc: pebolle@tiscali.nl, andreas.steffen@strongswan.org, tytso@mit.edu, sandyinchina@gmail.com, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org Subject: Re: [PATCH v7 1/5] random: Blocking API for accessing nonblocking_pool Message-ID: <20150520184535.GA15438@gondor.apana.org.au> References: <1693038.ndeE0L22jl@tachyon.chronox.de> <143216583.t5fUODkLsI@tachyon.chronox.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <143216583.t5fUODkLsI@tachyon.chronox.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 20, 2015 at 07:44:39PM +0200, Stephan Mueller wrote: > > + if (unlikely(nonblocking_pool.initialized == 0)) { > + do { > + rc = wait_event_interruptible(urandom_init_wait, > + nonblocking_pool.initialized); > + } while (rc == -ERESTARTSYS); This is just a convoluted way of doing an uninterruptible sleep. Either make it uninterruptible or allow the function to return an error. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt