mm/gup: Let __get_user_pages_locked() return -EINTR for fatal signal

__get_user_pages_locked() will return 0 instead of -EINTR after commit
4426e945df ("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: 4426e945df ("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]>
This commit is contained in:
Hillf Danton authored and Linus Torvalds committed 2020-04-08 09:05:58 -07:00
1 parent f5e94d10e4
commit ae46d2aa6a
1 file changed
+4 -1
+4 -1
View File
@@ -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) {