[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200409071133.31734-1-mhocko@kernel.org>
Date: Thu, 9 Apr 2020 09:11:33 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Xu <peterx@...hat.com>, Hillf Danton <hdanton@...a.com>,
<linux-mm@...ck.org>, LKML <linux-kernel@...r.kernel.org>,
Michal Hocko <mhocko@...e.com>
Subject: [PATCH] mm, gup: return EINTR when gup is interrupted by fatal signals
From: Michal Hocko <mhocko@...e.com>
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 handling will happen before returning to the userspace.
Signed-off-by: Michal Hocko <mhocko@...e.com>
---
mm/gup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/gup.c b/mm/gup.c
index 6076df8e04a4..50681f0286de 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1088,7 +1088,7 @@ static long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
* potentially allocating memory.
*/
if (fatal_signal_pending(current)) {
- ret = -ERESTARTSYS;
+ ret = -EINTR;
goto out;
}
cond_resched();
--
2.25.1
Powered by blists - more mailing lists