lkml.org 
[lkml]   [2022]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] random: allow partial reads if later user copies fail
Hi David,

On 4/8/22, David Laight <David.Laight@aculab.com> wrote:
> From: Jason A. Donenfeld
>> Sent: 08 April 2022 00:36
>>
>> Rather than failing entirely if a copy_to_user() fails at some point,
>> instead we should return a partial read for the amount that succeeded
>> prior, unless none succeeded at all, in which case we return -EFAULT as
>> before.
>
> I think you now return -EFAULT for a zero length read.

The diff context doesn't show it, but the first line of the function
is `if (!nbytes) return 0;`, before various other bits of work are
done.

Jason

\
 
 \ /
  Last update: 2022-04-08 12:35    [W:0.060 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site