LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH -mm 2/2] send_sigqueue: don't forget about handle_stop_signal()
@ 2008-03-05 21:53 Oleg Nesterov
  2008-03-05 23:52 ` Oleg Nesterov
  2008-03-06 11:06 ` Roland McGrath
  0 siblings, 2 replies; 3+ messages in thread
From: Oleg Nesterov @ 2008-03-05 21:53 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Pavel Emelyanov, Roland McGrath, Thomas Gleixner, linux-kernel

(on top of Pavel's signals-consolidate-send_sigqueue-and-send_group_sigqueue.patch)

send_group_sigqueue() calls handle_stop_signal(), send_sigqueue() doesn't.
This is not consistent and in fact I'd say this is (minor) bug.

Move handle_stop_signal() from send_group_sigqueue() to do_send_sigqueue(),
the latter is called by send_sigqueue() too.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- 25/kernel/signal.c~2_SS_HSS	2008-03-06 00:35:35.000000000 +0300
+++ 25/kernel/signal.c	2008-03-06 00:43:50.000000000 +0300
@@ -1274,8 +1274,10 @@ void sigqueue_free(struct sigqueue *q)
 }
 
 static int do_send_sigqueue(int sig, struct sigqueue *q, struct task_struct *t,
-		struct sigpending *pending)
+				struct sigpending *pending)
 {
+	handle_stop_signal(sig, t);
+
 	if (unlikely(!list_empty(&q->list))) {
 		/*
 		 * If an SI_TIMER entry is already queue just increment
@@ -1335,7 +1337,6 @@ send_group_sigqueue(int sig, struct sigq
 	read_lock(&tasklist_lock);
 	/* Since it_lock is held, p->sighand cannot be NULL. */
 	spin_lock_irqsave(&p->sighand->siglock, flags);
-	handle_stop_signal(sig, p);
 
 	ret = do_send_sigqueue(sig, q, p, &p->signal->shared_pending);
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -mm 2/2] send_sigqueue: don't forget about handle_stop_signal()
  2008-03-05 21:53 [PATCH -mm 2/2] send_sigqueue: don't forget about handle_stop_signal() Oleg Nesterov
@ 2008-03-05 23:52 ` Oleg Nesterov
  2008-03-06 11:06 ` Roland McGrath
  1 sibling, 0 replies; 3+ messages in thread
From: Oleg Nesterov @ 2008-03-05 23:52 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Pavel Emelyanov, Roland McGrath, Thomas Gleixner, linux-kernel

On 03/06, Oleg Nesterov wrote:
>
> (on top of Pavel's signals-consolidate-send_sigqueue-and-send_group_sigqueue.patch)
> 
> send_group_sigqueue() calls handle_stop_signal(), send_sigqueue() doesn't.
> This is not consistent and in fact I'd say this is (minor) bug.
> 
> Move handle_stop_signal() from send_group_sigqueue() to do_send_sigqueue(),
> the latter is called by send_sigqueue() too.

Sorry for the noise, but I forgot to mention that this patch of course depends
on signals-re-assign-cld_continued-notification-from-the-sender-to-reciever.patch

Oleg.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -mm 2/2] send_sigqueue: don't forget about handle_stop_signal()
  2008-03-05 21:53 [PATCH -mm 2/2] send_sigqueue: don't forget about handle_stop_signal() Oleg Nesterov
  2008-03-05 23:52 ` Oleg Nesterov
@ 2008-03-06 11:06 ` Roland McGrath
  1 sibling, 0 replies; 3+ messages in thread
From: Roland McGrath @ 2008-03-06 11:06 UTC (permalink / raw)
  To: Oleg Nesterov
  Cc: Andrew Morton, Pavel Emelyanov, Thomas Gleixner, linux-kernel

> send_group_sigqueue() calls handle_stop_signal(), send_sigqueue() doesn't.
> This is not consistent and in fact I'd say this is (minor) bug.

Yes, it was wrong.  I think I noticed it long ago and never bothered with
it because send_sigqueue is nearly unused.  SIGEV_THREAD_ID is in practice
only used internally by libc (timer_create) to implement SIGEV_THREAD, and
it never uses any of the signals handle_stop_signal checks for.

Your fix is good and should go in.
I'd bet noone will ever notice the difference now or ever.


Thanks,
Roland

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-03-06 11:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-05 21:53 [PATCH -mm 2/2] send_sigqueue: don't forget about handle_stop_signal() Oleg Nesterov
2008-03-05 23:52 ` Oleg Nesterov
2008-03-06 11:06 ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).