Skip to content

Commit ae46d2a

Browse files
Hillf Dantontorvalds
authored andcommitted
mm/gup: Let __get_user_pages_locked() return -EINTR for fatal signal
__get_user_pages_locked() will return 0 instead of -EINTR after commit 4426e94 ("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: 4426e94 ("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]>
1 parent f5e94d1 commit ae46d2a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mm/gup.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1326,8 +1326,11 @@ static __always_inline long __get_user_pages_locked(struct task_struct *tsk,
13261326
* start trying again otherwise it can loop forever.
13271327
*/
13281328

1329-
if (fatal_signal_pending(current))
1329+
if (fatal_signal_pending(current)) {
1330+
if (!pages_done)
1331+
pages_done = -EINTR;
13301332
break;
1333+
}
13311334

13321335
ret = down_read_killable(&mm->mmap_sem);
13331336
if (ret) {

0 commit comments

Comments
 (0)