public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Andrey Vagin <avagin@openvz.org>
Cc: linux-kernel@vger.kernel.org, criu@openvz.org,
	linux-api@vger.kernel.org, Roland McGrath <roland@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	David Howells <dhowells@redhat.com>,
	Dave Jones <davej@redhat.com>,
	"Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
	Pavel Emelyanov <xemul@parallels.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Pedro Alves <palves@redhat.com>
Subject: Re: [PATCH 1/2] ptrace: add ability to retrieve signals without removing from a queue (v3)
Date: Wed, 27 Feb 2013 19:38:50 +0100	[thread overview]
Message-ID: <20130227183850.GA6042@redhat.com> (raw)
In-Reply-To: <1361975829-1738-1-git-send-email-avagin@openvz.org>

On 02/27, Andrey Vagin wrote:
>
> +struct ptrace_peeksiginfo_args {
> +	__u64 off;	/* from which siginfo to start */

Cough... You are optimist. You want to handle the case when the
tracee has 1 << 33 or more pending sigqueues. OK good luck ;)

Looks correct, just one nit.

> +	for (i = 0; i < arg.nr; i++) {
> ...
> +		data += sizeof(siginfo_t);
> +
> +		if (signal_pending(current)) {
> +			i++; /* accounting the current siginfo */
> +			break;
> +		}

Imho, this is confusing. Just do

	for (i = 0; i < arg.nr; ) {
		...

		data += sizeof(siginfo_t);
		i++;

		if (signal_pending(current))
			break;

Oleg.


      parent reply	other threads:[~2013-02-27 18:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-27 14:37 [PATCH 1/2] ptrace: add ability to retrieve signals without removing from a queue (v3) Andrey Vagin
2013-02-27 14:37 ` [PATCH 2/2] selftest: add a test case for PTRACE_PEEKSIGINFO Andrey Vagin
2013-02-27 18:38 ` Oleg Nesterov [this message]

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=20130227183850.GA6042@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=avagin@openvz.org \
    --cc=criu@openvz.org \
    --cc=davej@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=palves@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=roland@redhat.com \
    --cc=torvalds@linux-foundation.org \
    --cc=xemul@parallels.com \
    /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