From: Trond Myklebust Subject: Re: filesystem signal handling Date: Wed, 28 Apr 2004 22:53:16 -0400 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <1083207196.2856.220.camel@lade.trondhjem.org> References: <1083097744.4780.20.camel@stevef95.austin.ibm.com> <1083165278.4694.12.camel@localhost.localdomain> <1083171946.2856.63.camel@lade.trondhjem.org> <1083172459.4694.27.camel@localhost.localdomain> <1083173539.2856.90.camel@lade.trondhjem.org> <20040428192835.GA2836@mail.shareable.org> <1083205102.4694.39.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Jamie Lokier , Steve French , linux-fsdevel@vger.kernel.org Return-path: Received: from dh132.citi.umich.edu ([141.211.133.132]:56469 "EHLO lade.trondhjem.org") by vger.kernel.org with ESMTP id S263000AbUD2Cx1 (ORCPT ); Wed, 28 Apr 2004 22:53:27 -0400 To: David Woodhouse In-Reply-To: <1083205102.4694.39.camel@localhost.localdomain> List-Id: linux-fsdevel.vger.kernel.org On Wed, 2004-04-28 at 22:18, David Woodhouse wrote: > That was the difference I was thinking of -- since if they're not > _handled_, all three of the mentioned signals remain fatal and hence the > resulting behaviour is basically the same with either implementation. > (playing with the mask vs. allowing only fatal signals). They are very different. "Playing with the mask" restricts which signals are considered to be fatal. The "intr" mount option is pretty particular about that. > It's the case of a handled SIGINT during NFS operations which is > potentially different. If that happens when a read() or write() is > partially complete, what do we currently do? Is it really mandatory that > we do handle the signal immediately rather than upon completion of the > operation, or is this a corner case which nobody cares about? As I said earlier: if the signal is handled, we mask it. See the discussion about non-idempotent operations and the dangers of retrying them. I'm not entirely sure that is the reason for masking the handled case (rpc_clnt_sigmask() predates my maintainership of the NFS client), but I suspect that it might be. I should really ask Alan Cox for what his motivations were. IIRC, he wrote that code... > But I wasn't necessarily suggesting that NFS should change its > behaviour, only offering a potential answer to the question which was > posed, which was presumably for CIFS not NFS. I would imagine that CIFS has similar problems to NFS here. One of the main points of playing with the sigmask in the first place is that interrupting an operation in the middle of the RPC call leaves various attribute/data caches in an incoherent state, and so is in general bad practice. We certainly don't want something like a poorly coded application that generates the occasional SIGSEGV or SIGBUS (or even a well-coded one that uses timers + SIGALRM!) to screw up the cached data/metadata for everyone else. Cheers, Trond