All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: Matthew Wilcox <matthew@wil.cx>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: Proposal for a new lock type
Date: Sun, 15 Aug 2010 19:11:01 +0200	[thread overview]
Message-ID: <87mxsner8a.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <20100815165858.GF12892@parisc-linux.org> (Matthew Wilcox's message of "Sun, 15 Aug 2010 10:58:58 -0600")

* Matthew Wilcox:

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

In the sense that I described?  This surprises me.

(I know that there is something called Distributed Shared Memory.  But
it's generally got different properties than a mapped file, AFAIK.)

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

That's not a problem for this use case.  It's about making sure that
an SQLite-using application cannot accidentally access the same
database without proper locking because the mutexes are not visible
across a network file system.

      reply	other threads:[~2010-08-15 17:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-15 15:06 Proposal for a new lock type Florian Weimer
2010-08-15 16:58 ` Matthew Wilcox
2010-08-15 17:11   ` Florian Weimer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mxsner8a.fsf@mid.deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=matthew@wil.cx \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.