public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Denys Vlasenko <dvlasenk@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] epoll_[p]wait: fix spurious -EINTR on ptrace attach
Date: Tue, 25 Jun 2013 22:06:23 +0200	[thread overview]
Message-ID: <20130625200623.GA15267@redhat.com> (raw)
In-Reply-To: <20130625184619.GA4003@redhat.com>

On 06/25, Oleg Nesterov wrote:
>
> On 06/25, Denys Vlasenko wrote:
> >
> > Before this change, epoll_wait and epoll_pwait
> > spuriously return with -EINTR on ptrace attach.
> >
> > By analogy with poll syscall family, epoll_[p]wait should be interruptible
> > by signals regardless of SA_RESTART, therefore, this change
> > makes them return -ERESTARTNOHAND if timeout has expired.
>
> Denys, I am not even going to actuallu read this patch, but I think
> you should redo it in any case... And you need to cc maintainers.

Yes... but when I look at it again I think that "timeout" logic is
still wrong.

	restart_block->epoll.timeout = rem_msec;

this obviously means the remaining timeout, yes?

If yes, this is not right. Suppose that we return ERESTART_RESTARTBLOCK
due to SIGSTOP. The task can sleep in TASK_STOPPED "forever", we should
not restart with "timeout = rem_msec" after that.

You need the end_time logic like sys_poll() does.

> Because I believe we should cleanup fs/eventpoll.c first, I'll try
> to send the patch(es) soon.

Please see the patches I sent.

> > In order to define a "sigset_t ksigmask" member,
>
> You do not need it. But the reason is not clear until the cleanup.

I take this back, this is not as simple as I thought... and perhaps even
not right.

However. Probably you can replace has_ksigmask + ksigmask by
"sigset_t __user *sigmask" pointer?

Oleg.


  reply	other threads:[~2013-06-25 20:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-25 15:05 [PATCH] epoll_[p]wait: fix spurious -EINTR on ptrace attach Denys Vlasenko
2013-06-25 18:46 ` Oleg Nesterov
2013-06-25 20:06   ` Oleg Nesterov [this message]
2013-06-26  7:43     ` Denys Vlasenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130625200623.GA15267@redhat.com \
    --to=oleg@redhat.com \
    --cc=dvlasenk@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox