[113] in arla-drinkers

home help back first fref pref prev next nref lref last post

Re: flock and fcntl(F_SETLK)

daemon@ATHENA.MIT.EDU (Steven N. Hirsch)
Sun Jul 19 20:08:45 1998

From arla-drinkers-request@sundance.stacken.kth.se Mon Jul 20 00:08:44 1998
Return-Path: <arla-drinkers-request@sundance.stacken.kth.se>
Delivered-To: arla-drinkers-mtg@bloom-picayune.mit.edu
Received: (qmail 14786 invoked from network); 20 Jul 1998 00:08:44 -0000
Received: from unknown (HELO sundance.stacken.kth.se) (130.237.234.41)
  by bloom-picayune.mit.edu with SMTP; 20 Jul 1998 00:08:44 -0000
Received: from air.steve.net (surf152.bur.adelphia.net [24.48.40.152])
	by sundance.stacken.kth.se (8.8.8/8.8.8) with SMTP id CAA26092;
	Mon, 20 Jul 1998 02:03:31 +0200 (MET DST)
Received: from localhost (hirsch@localhost) by air.steve.net (8.6.12/8.6.9) with SMTP id UAA03995; Sun, 19 Jul 1998 20:06:08 -0400
X-Authentication-Warning: air.steve.net: hirsch owned process doing -bs
Date: Sun, 19 Jul 1998 20:06:08 -0400 (EDT)
From: "Steven N. Hirsch" <shirsch@adelphia.net>
X-Sender: hirsch@air.steve.net
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
cc: Magnus Ahltorp <map@stacken.kth.se>, linux-kernel@vger.rutgers.edu,
        arla-drinkers@stacken.kth.se
Subject: Re: flock and fcntl(F_SETLK)
In-Reply-To: <m0yy2SR-000aNQC@the-village.bc.nu>
Message-ID: <Pine.LNX.3.96.980719200321.3989A-100000@air.steve.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII



On Mon, 20 Jul 1998, Alan Cox wrote:

> > fcntl(F_SETLK) uses the f_op->lock(), so why doesn't flock() have a
> > similar hook in the file system?
> > 
> > This inconsistency makes flock() broken when using network file
> > systems that have proper locking (like AFS). How is this supposed to
> > be implemented in network file systems?
> 
> The semantics of flock not locking on network file systems go back to
> SunOS and make some sense. flock() gives you a locking scheme that is
> local and fast, lockf/fcntl locks give you slow but networked NFS locks.

Really?  That's news to me.  We use flock() over NFS routinely at work.
This is between AIX 4.x machines and from AIX <--> Digital Unix 4.0.  Oh,
and it also works over AFS (file lock only - byte-range locking is
promised for DFS).

Steve



home help back first fref pref prev next nref lref last post