[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFxe+Ku78ZEvd_F2TD_3gTmLXw0kzo4HDE-ngkYfSHQfPw@mail.gmail.com>
Date: Tue, 24 Jul 2018 13:56:05 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: Oleg Nesterov <oleg@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Wen Yang <wen.yang99@....com.cn>, majiang <ma.jiang@....com.cn>
Subject: Re: [PATCH v2 20/20] signal: Don't restart fork when signals come in.
On Tue, Jul 24, 2018 at 1:40 PM Eric W. Biederman <ebiederm@...ssion.com> wrote:
>
> + if (signal_pending(current)) {
> + retval = restart_syscall();
> + goto fork_out;
> + }
Oh, the previous version had this too, but it wasn't as obvious
because it was just in a single line:
return ERR_PTR(restart_syscall());
but it's just crazy.
It should just be
retval = -ERESTARTNOINTR;
if (signal_pending(current))
goto fork_out;
because it's just silly and pointless to change the code to use
restart_syscall() here.
All restart_syscall() does is
set_tsk_thread_flag(current, TIF_SIGPENDING);
return -ERESTARTNOINTR;
and you just *checked* that TIF_SIGPENDING was already set. So the
above is completely pointless.
It is not clear why you made that change. The old code had the simpler
"just return -ERESTARTNOINTR" model.
Did the restart_syscall() thing come in by mistake from some previous
trials and it just hung around?
Linus
Powered by blists - more mailing lists