lkml.org 
[lkml]   [2018]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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@xmission.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

\
 
 \ /
  Last update: 2018-07-24 22:56    [W:0.089 / U:2.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site