lkml.org 
[lkml]   [2019]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask()
On 06/04, Eric W. Biederman wrote:
>
> >> - restore_user_sigmask(ksig.sigmask, &sigsaved);
> >> - if (signal_pending(current) && !ret)
> >> +
> >> + interrupted = signal_pending(current);
> >> + restore_user_sigmask(ksig.sigmask, &sigsaved, interrupted);
> >> + if (interrupted && !ret)
> >> ret = -ERESTARTNOHAND;
> >
> > are wrong to begin with, and we really should aim for an interface
> > which says "tell me whether you completed the system call, and I'll
> > give you an error return if not".
>
> The pattern you are pointing out is specific to io_pgetevents and it's
> variations. It does look buggy to me but not for the reason you point
> out, but instead because it does not appear to let a pending signal
> cause io_pgetevents to return early.
>
> I suspect we should fix that and have do_io_getevents return
> -EINTR or -ERESTARTNOHAND like everyone else.

Exactly. It should not even check signal_pending(). It can rely on
wait_event_interruptible_hrtimeout().

> So can we please get this fix in and then look at cleaning up and
> simplifying this code.

Yes ;)

Oleg.

\
 
 \ /
  Last update: 2019-06-05 11:06    [W:0.135 / U:14.648 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site