From: Michal Hocko Date: Tue, 21 Apr 2020 01:13:55 +0000 (-0700) Subject: mm, gup: return EINTR when gup is interrupted by fatal signals X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d180870d83dbb076fabd6d469f2626c071f12255;p=linux.git mm, gup: return EINTR when gup is interrupted by fatal signals EINTR is the usual error code which other killable interfaces return. This is the case for the other fatal_signal_pending break out from the same function. Make the code consistent. ERESTARTSYS is also quite confusing because the signal is fatal and so no restart will happen before returning to the userspace. Signed-off-by: Michal Hocko Signed-off-by: Andrew Morton Acked-by: Linus Torvalds Cc: Peter Xu Cc: Hillf Danton Link: http://lkml.kernel.org/r/20200409071133.31734-1-mhocko@kernel.org Signed-off-by: Linus Torvalds --- diff --git a/mm/gup.c b/mm/gup.c index 6076df8e04a4e..50681f0286ded 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1088,7 +1088,7 @@ retry: * potentially allocating memory. */ if (fatal_signal_pending(current)) { - ret = -ERESTARTSYS; + ret = -EINTR; goto out; } cond_resched();