All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-kernel@vger.kernel.org, Matt Mackall <mpm@selenic.com>,
	linux-crypto@vger.kernel.org
Subject: Re: [PATCH] hw_random: core, sleep interruptible in read
Date: Fri, 27 Nov 2015 16:40:34 +0100	[thread overview]
Message-ID: <56587972.8050405@suse.cz> (raw)
In-Reply-To: <20151127130603.GA29503@gondor.apana.org.au>

On 11/27/2015, 02:06 PM, Herbert Xu wrote:
> On Thu, Nov 26, 2015 at 08:56:29PM +0100, Jiri Slaby wrote:
>>
>> diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
>> index a064237ff362..f003df162e09 100644
>> --- a/drivers/char/hw_random/core.c
>> +++ b/drivers/char/hw_random/core.c
>> @@ -238,7 +238,10 @@ static ssize_t rng_dev_read(struct file *filp, char __user *buf,
>>  			goto out;
>>  		}
>>  
>> -		mutex_lock(&reading_mutex);
>> +		if (mutex_lock_interruptible(&reading_mutex)) {
>> +			err = -EINTR;
> 
> Shouldn't this be ERESTARTSYS?

Yes, it actually can, given the retval is returned only if no data were
read yet.

thanks,
-- 
js
suse labs

  reply	other threads:[~2015-11-27 15:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26 19:56 [PATCH] hw_random: core, sleep interruptible in read Jiri Slaby
2015-11-27 13:06 ` Herbert Xu
2015-11-27 15:40   ` Jiri Slaby [this message]
2015-11-27 15:50   ` [PATCH v2] " Jiri Slaby
2015-12-04 14:40     ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56587972.8050405@suse.cz \
    --to=jslaby@suse.cz \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.