All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Linux-Fsdevel <linux-fsdevel@vger.kernel.org>
Cc: mtk.manpages@gmail.com, Jeff Layton <jlayton@redhat.com>,
	Neil Brown <neilb@suse.de>, Theodore T'so <tytso@mit.edu>,
	Christoph Hellwig <hch@infradead.org>,
	Andy Lutomirski <luto@amacapital.net>
Subject: Status of fcntl() mandatory locking
Date: Sun, 27 Apr 2014 17:35:52 +0200	[thread overview]
Message-ID: <535D23D8.8080005@gmail.com> (raw)

Hello all,

For a long time now, the fcntl(2) man page has carried this text
regarding mandatory (byte-range) locking:


   Mandatory locking
       The  implementation  of mandatory locking in all known versions
       of Linux is subject to race conditions which render it  unreli‐
       able: a write(2) call that overlaps with a lock may modify data
       after the mandatory lock is acquired; a read(2) call that over‐
       laps with a lock may detect changes to data that were made only
       after a write lock was acquired.  Similar races  exist  between
       mandatory  locks  and  mmap(2).  It is therefore inadvisable to
       rely on mandatory locking.

I wanted to check: does it remain true with modern kernels that mandatory
locking is unreliable? If things have changed, an uopdate to the man page
is obviously in order.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2014-04-27 15:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-27 15:35 Michael Kerrisk (man-pages) [this message]
2014-04-28 10:07 ` Status of fcntl() mandatory locking Jeff Layton
2014-04-29  5:21   ` Michael Kerrisk (man-pages)

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=535D23D8.8080005@gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=hch@infradead.org \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=neilb@suse.de \
    --cc=tytso@mit.edu \
    /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.