From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: "Joseph D. Wagner" <theman@josephdwagner.info>
Cc: <linux-fsdevel@vger.kernel.org>
Subject: Re: Does mandatory locking need to be set when the file is locked?
Date: 15 Dec 2003 13:09:11 -0500 [thread overview]
Message-ID: <shswu8yj6m0.fsf@guts.uio.no> (raw)
In-Reply-To: <000001c3c323$24154030$0201a8c0@joe>
>>>>> " " == Joseph D Wagner <theman@josephdwagner.info> writes:
> My program DEPENDS upon mandatory locking, so I'd like a little
> more info before I abandon that route entirely.
Then don't be surprised if it cannot work on networked filesystems.
NFS is, for instance, incapable of supporting mandatory locks in v2
and v3 (v4 will support it for ordinary files).
What's more, mmap() is forbidden on on any file with mandatory
locks (this is true for all filesystems).
Finally, the Linux mandatory locking implementation does not eliminate
all possible races: currently there is no attempt made to exclude one
thread from taking a lock while another is still in the process of
writing to the file, or if it already has a section of that file
mmapped. In that case, the lock call may well succeed, but the
other thread that is inside read/write/mmap will not see it.
So if you want to DEPEND on mandatory locking to work, then you
probably have some kernel debugging to do first.
Cheers,
Trond
next prev parent reply other threads:[~2003-12-15 18:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-15 1:57 Does mandatory locking need to be set when the file is locked? Joseph D. Wagner
2003-12-15 15:38 ` Matthew Wilcox
2003-12-15 15:50 ` Joseph D. Wagner
2003-12-15 16:23 ` Randy.Dunlap
2003-12-15 18:09 ` Trond Myklebust [this message]
2003-12-15 18:59 ` Matthew Wilcox
2003-12-16 19:13 ` Bryan Henderson
2003-12-16 20:33 ` Mike Fedyk
2003-12-16 21:48 ` Trond Myklebust
2003-12-16 22:00 ` Mike Fedyk
2003-12-15 17:05 ` Bryan Henderson
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=shswu8yj6m0.fsf@guts.uio.no \
--to=trond.myklebust@fys.uio.no \
--cc=linux-fsdevel@vger.kernel.org \
--cc=theman@josephdwagner.info \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox