linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm, gup: return EINTR when gup is interrupted by fatal signals
@ 2020-04-09  7:11 Michal Hocko
  2020-04-09 19:55 ` Linus Torvalds
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Hocko @ 2020-04-09  7:11 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linus Torvalds, Peter Xu, Hillf Danton, linux-mm, LKML, Michal Hocko

From: Michal Hocko <mhocko@suse.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@suse.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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm, gup: return EINTR when gup is interrupted by fatal signals
  2020-04-09  7:11 [PATCH] mm, gup: return EINTR when gup is interrupted by fatal signals Michal Hocko
@ 2020-04-09 19:55 ` Linus Torvalds
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 2020-04-09 19:55 UTC (permalink / raw)
  To: Michal Hocko
  Cc: Andrew Morton, Peter Xu, Hillf Danton, Linux-MM, LKML, Michal Hocko

On Thu, Apr 9, 2020 at 12:11 AM Michal Hocko <mhocko@kernel.org> wrote:
>
> ERESTARTSYS is also quite confusing because the signal is fatal and so
> no handling will happen before returning to the userspace.

Ack. Except I'd rephrase that as "no restart" rather than "no handling".

We do end up handling the fatal signal, it's just that the handling
doesn't involve restarting, it just involves dying.

That said, I'll leave this to the usual channels, since it isn't
exactly the same kind of urgent fix that I picked up directly..

              Linus


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-09 19:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09  7:11 [PATCH] mm, gup: return EINTR when gup is interrupted by fatal signals Michal Hocko
2020-04-09 19:55 ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).