]> Git Repo - linux.git/commitdiff
mm/gup: Let __get_user_pages_locked() return -EINTR for fatal signal
authorHillf Danton <[email protected]>
Wed, 8 Apr 2020 15:59:24 +0000 (11:59 -0400)
committerLinus Torvalds <[email protected]>
Wed, 8 Apr 2020 16:05:58 +0000 (09:05 -0700)
__get_user_pages_locked() will return 0 instead of -EINTR after commit
4426e945df588 ("mm/gup: allow VM_FAULT_RETRY for multiple times") which
added extra code to allow gup detect fatal signal faster.

Restore the original -EINTR behavior.

Cc: Andrew Morton <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Fixes: 4426e945df58 ("mm/gup: allow VM_FAULT_RETRY for multiple times")
Reported-by: [email protected]
Signed-off-by: Hillf Danton <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Signed-off-by: Peter Xu <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/gup.c

index afce0bc47e70124d20947b569e8877f1396f9c1a..6076df8e04a4e74dbb1405aa0e28ec9c72b59c4b 100644 (file)
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1326,8 +1326,11 @@ retry:
                 * start trying again otherwise it can loop forever.
                 */
 
-               if (fatal_signal_pending(current))
+               if (fatal_signal_pending(current)) {
+                       if (!pages_done)
+                               pages_done = -EINTR;
                        break;
+               }
 
                ret = down_read_killable(&mm->mmap_sem);
                if (ret) {
This page took 0.051215 seconds and 4 git commands to generate.