Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932402AbWCPQ2v (ORCPT ); Thu, 16 Mar 2006 11:28:51 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932413AbWCPQ2v (ORCPT ); Thu, 16 Mar 2006 11:28:51 -0500 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:10722 "EHLO ebiederm.dsl.xmission.com") by vger.kernel.org with ESMTP id S932406AbWCPQ2u (ORCPT ); Thu, 16 Mar 2006 11:28:50 -0500 To: Oleg Nesterov Cc: Andrew Morton , Ingo Molnar , Roland McGrath , linux-kernel@vger.kernel.org, Michael Kerrisk Subject: Re: [PATCH] make fork() atomic wrt pgrp/session signals References: <44198BC4.EE653B1@tv-sign.ru> From: ebiederm@xmission.com (Eric W. Biederman) Date: Thu, 16 Mar 2006 09:27:31 -0700 In-Reply-To: <44198BC4.EE653B1@tv-sign.ru> (Oleg Nesterov's message of "Thu, 16 Mar 2006 19:01:08 +0300") Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1396 Lines: 34 Oleg Nesterov writes: > Eric W. Biederman wrote: >> >> Ok. SUSV3/Posix is clear, fork is atomic with respect >> to signals. Either a signal comes before or after a >> fork but not during. (See the rationale section). >> http://www.opengroup.org/onlinepubs/000095399/functions/fork.html >> >> The tasklist_lock does not stop forks from adding to a process >> group. The forks stall while the tasklist_lock is held, but a fork >> that began before we grabbed the tasklist_lock simply completes >> afterwards, and the child does not receive the signal. > > This also means that SIGSTOP or sig_kernel_coredump() signal can't > be delivered to pgrp/session reliably. > > With this patch copy_process() returns -ERESTARTNOINTR when it > detects a pending signal, fork() will be restarted transparently > after handling the signals. > > This patch also deletes now unneeded "group_stop_count > 0" check, > copy_process() can no longer succeed while group stop in progress. > > Signed-off-by: Oleg Nesterov Looks like what we discussed and I can't see any flaws with it. Acked-By: Eric Biederman - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/