From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18222 invoked from network); 18 Apr 2008 00:49:58 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Apr 2008 00:49:58 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 97927 invoked from network); 18 Apr 2008 00:49:54 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Apr 2008 00:49:54 -0000 Received: (qmail 9458 invoked by alias); 18 Apr 2008 00:49:51 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24834 Received: (qmail 9443 invoked from network); 18 Apr 2008 00:49:50 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 18 Apr 2008 00:49:50 -0000 Received: from prunille.vinc17.org (vinc17.pck.nerim.net [213.41.242.187]) by bifrost.dotsrc.org (Postfix) with ESMTP id 296318043AC7 for ; Fri, 18 Apr 2008 02:49:46 +0200 (CEST) Received: by prunille.vinc17.org (Postfix, from userid 501) id A98D421ABDD8; Fri, 18 Apr 2008 02:49:42 +0200 (CEST) Date: Fri, 18 Apr 2008 02:49:42 +0200 From: Vincent Lefevre To: zsh-workers@sunsite.dk Subject: Re: [PATCH] history locking with fcntl Message-ID: <20080418004942.GA1067@prunille.vinc17.org> Mail-Followup-To: zsh-workers@sunsite.dk References: <20080415153120.GE1223@prunille.vinc17.org> <20080417104054.295003e3@news01> <080417065834.ZM9193@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <080417065834.ZM9193@torch.brasslantern.com> X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.17-vl-r21552 (2008-03-11) X-Virus-Scanned: ClamAV 0.91.2/6815/Fri Apr 18 01:56:17 2008 on bifrost X-Virus-Status: Clean On 2008-04-17 06:58:34 -0700, Bart Schaefer wrote: > On Apr 17, 10:40am, Peter Stephenson wrote: > } pindex(HIST_FCNTL_LOCK) > } provide better performance, in particular avoiding history corruption when > } files are stored on NFS. > > Really? Traditionally fcntl() has been a lousy way to lock over NFS. AFAIK, it's the only way to prevent some corruption due to file caching. > Procmail, for example, has acres of code to handle using secondary > files as semaphores precisely because nothing else was reliable over > NFS But procmail *also* uses fcntl. My patch still uses the old lock mechanism, it just adds fcntl locking. That said, I often use fcntl only, without any problem. > (more specifically, only creat() was guaranteed to be atomic and > lock daemons were flaky). Some software, like Firefox, uses symlink() locking. So, if symlink() isn't atomic, there will be problems with such software. > I guess my point is that while fcntl() may be good on recent OSs (or > recent versions of NFS, more likely) it's dangerous in an environment > where you don't know what the NFS server is using (no matter how recent > the local NFS client is). I don't see why it can be dangerous if it is used in addition to another lock mechanism, like it currently is. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)