From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: Proposal for a new lock type Date: Sun, 15 Aug 2010 10:58:58 -0600 Message-ID: <20100815165858.GF12892@parisc-linux.org> References: <871v9zkj8t.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Florian Weimer Return-path: Received: from palinux.external.hp.com ([192.25.206.14]:37939 "EHLO mail.parisc-linux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757664Ab0HOQ7A (ORCPT ); Sun, 15 Aug 2010 12:59:00 -0400 Content-Disposition: inline In-Reply-To: <871v9zkj8t.fsf@mid.deneb.enyo.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sun, Aug 15, 2010 at 05:06:58PM +0200, Florian Weimer wrote: > It seems that it might be useful to have a locally shared, globally > exclusive file lock. "Local" is defined as "when the file is mapped > shared, memory accesses follow the architecture memory model across > threads and processes, and shared POSIX mutexes work". This could be > used to make the new WAL code in SQLite 3.7 more foolproof, but there > are other applications which would benefit as well. This sounds like you're trying to fix a problem with NFS. I think there are network filesystems which practice mmap coherency. We could define a sideband protocol for NFS that would allow NFS to act the same way. > It seems to me that this would not need changes to network file > systems because you can implement it by acquring a traditional > fcntl()-style exclusive lock on the network side, without creating a > corresponding local lock. fcntl locks are advisory ... I think you actually want leases / oplocks. More than that, you probably want range oplocks rather than file scope oplocks. -- Matthew Wilcox Intel Open Source Technology Centre "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step."