From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH] coda: kill file_count abuse Date: Fri, 20 Jul 2007 04:16:31 +0100 Message-ID: <20070720031631.GC21668@ftp.linux.org.uk> References: <20070719214508.GA4482@lst.de> <20070719221559.GI8857@delft.aura.cs.cmu.edu> <20070720004534.GA31489@sgi.com> <20070720005316.GA21668@ftp.linux.org.uk> <20070720023601.GC31489@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , akpm@osdl.org, linux-fsdevel@vger.kernel.org To: David Chinner Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:47492 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752997AbXGTDQo (ORCPT ); Thu, 19 Jul 2007 23:16:44 -0400 Content-Disposition: inline In-Reply-To: <20070720023601.GC31489@sgi.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, Jul 20, 2007 at 12:36:01PM +1000, David Chinner wrote: > To the context that dropped the last reference. It can't be > reported to anything else.... Oh, for fsck sake... Send a datagram with SCM_RIGHTS in it. Have all other references to these files closed. Now have close(2) kill the socket that might eventually be used to receive the datagram. Now, all these files are closed. Tell me, which error value would you report to that caller of close() and how would it guess which files had those been? Consider munmap(). It can release the last reference to any number of files (mmap them in different places, then munmap the entire area). Which error would you report? Consider exit(), for crying out loud. You have a file opened. You fork a child. You close the file in parent. Child goes away. Who do you report that stuff?