Commit ae46d2aa authored by Hillf Danton's avatar Hillf Danton Committed by Linus Torvalds
Browse files

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

__get_user_pages_locked() will return 0 instead of -EINTR after commit
4426e945 ("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 <>
Cc: Thomas Gleixner <>
Cc: Peter Zijlstra <>
Fixes: 4426e945

 ("mm/gup: allow VM_FAULT_RETRY for multiple times")
Signed-off-by: default avatarHillf Danton <>
Acked-by: default avatarMichal Hocko <>
Signed-off-by: default avatarPeter Xu <>
Signed-off-by: default avatarLinus Torvalds <>
parent f5e94d10
......@@ -1326,8 +1326,11 @@ static __always_inline long __get_user_pages_locked(struct task_struct *tsk,
* start trying again otherwise it can loop forever.
if (fatal_signal_pending(current))
if (fatal_signal_pending(current)) {
if (!pages_done)
pages_done = -EINTR;
ret = down_read_killable(&mm->mmap_sem);
if (ret) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment