From owner-freebsd-hackers Mon Aug 23 20:36:19 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from cheddar.netmonger.net (cheddar.netmonger.net [209.54.21.140]) by hub.freebsd.org (Postfix) with ESMTP id 82DCB1577F; Mon, 23 Aug 1999 20:36:09 -0700 (PDT) (envelope-from chris@cheddar.netmonger.net) Received: (from chris@localhost) by cheddar.netmonger.net (8.8.8/8.8.8) id XAA18150; Mon, 23 Aug 1999 23:34:34 -0400 (EDT) Message-ID: <19990823233434.C16133@netmonger.net> Date: Mon, 23 Aug 1999 23:34:34 -0400 From: Christopher Masto To: Greg Lehey Cc: Chuck Robey , Garance A Drosihn , "Daniel C. Sobral" , Poul-Henning Kamp , Matthew Dillon , FreeBSD Hackers , FreeBSD Committers , Garrett Wollman Subject: Re: Mandatory locking? References: <19990823223645.A14001@netmonger.net> <19990823231130.A16133@netmonger.net> <19990824125210.A83273@freebie.lemis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <19990824125210.A83273@freebie.lemis.com>; from Greg Lehey on Tue, Aug 24, 1999 at 12:52:10PM +0930 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Aug 24, 1999 at 12:52:10PM +0930, Greg Lehey wrote: > No, I think you're confusing opening and locking. It's something like > this: > > User 1 User 2 > > open file open file > lock file read file (blocks) > diddle file > unlock file > read completes How about a little timing difference? User 1 User 2 open file read file open file lock file (blocks?) close file lock returns open file (blocks) diddle file unlock file scribble over User 1's changes What I'm getting at is that if User 2 has to do something special anyway, it might as well be using advisory locking. > > That seems extremely dangerous, given all the time that such a thing > > hasn't been around.. > > I've been using it for 22 years now. > > > who knows how many scripts and programs will now be vulnerable to > > hanging forever.. > > Why? There is a danger, of course, that user 1 will lock the file and > not unlock it. That's a badly written program, so you stop it. End > of hang. That's not what I meant. It hasn't been on FreeBSD, so FreeBSD is not designed to deal with it. I mentioned a couple of examples.. if I lock a bunch of files in my web space, does apache get a bunch of children stuck forever? Who knows what might get tripped up? -- Christopher Masto Senior Network Monkey NetMonger Communications chris@netmonger.net info@netmonger.net http://www.netmonger.net Free yourself, free your machine, free the daemon -- http://www.freebsd.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message