lkml.org 
[lkml]   [2020]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] mm/gup: Let __get_user_pages_locked() return -EINTR for fatal signal
On Wed, Apr 8, 2020 at 8:59 AM Peter Xu <peterx@redhat.com> wrote:
>
> __get_user_pages_locked() will return 0 instead of -EINTR after commit
> 4426e945df588 which added extra code to allow gup detect fatal signal
> faster. Restore that behavior.

I've applied this, but it's worth noting that
__get_user_pages_locked() can still return 0 in other situations.

I realize that "I got zero pages" is a valid return value, but I do
wonder if we should make the rule be that a zero return value isn't
possible (return -EAGAIN or whatever if you doin't have the
EFAULT/EINTR conditions).

So that you'd always get either an error, or a successful number of pages.

The only case where __get_user_pages_locked() might return zero is if
you pass in a zero 'nr_pages', although I suspect even for that case
returning -EINVAL might be a better option.

Anyway, this is not a new issue, but I thought I'd mention it.

Linus

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