[112] 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 (Alan Cox)
Sun Jul 19 19:01:46 1998

From arla-drinkers-request@sundance.stacken.kth.se Sun Jul 19 23:01:45 1998
Return-Path: <arla-drinkers-request@sundance.stacken.kth.se>
Delivered-To: arla-drinkers-mtg@bloom-picayune.mit.edu
Received: (qmail 13940 invoked from network); 19 Jul 1998 23:01:45 -0000
Received: from unknown (HELO sundance.stacken.kth.se) (130.237.234.41)
  by bloom-picayune.mit.edu with SMTP; 19 Jul 1998 23:01:45 -0000
Received: from snowcrash.cymru.net (snowcrash.cymru.net [163.164.160.3])
	by sundance.stacken.kth.se (8.8.8/8.8.8) with ESMTP id AAA23604;
	Mon, 20 Jul 1998 00:56:19 +0200 (MET DST)
Received: from the-village.bc.nu (the-village.bc.nu [163.164.160.21]) by snowcrash.cymru.net (8.8.7/8.7.1) with SMTP id XAA25006; Sun, 19 Jul 1998 23:56:10 +0100
Received: by the-village.bc.nu (Smail3.1.29.1 #2)
	id m0yy2SR-000aNQC; Mon, 20 Jul 98 00:01 BST
Message-Id: <m0yy2SR-000aNQC@the-village.bc.nu>
From: alan@lxorguk.ukuu.org.uk (Alan Cox)
Subject: Re: flock and fcntl(F_SETLK)
To: map@stacken.kth.se (Magnus Ahltorp)
Date: Mon, 20 Jul 1998 00:01:30 +0100 (BST)
Cc: linux-kernel@vger.rutgers.edu, arla-drinkers@stacken.kth.se
In-Reply-To: <lv14swdy14u.fsf@yakko.stacken.kth.se> from "Magnus Ahltorp" at Jul 19, 98 11:36:01 pm
Content-Type: text

> 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.

Alan


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