linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Status of fcntl() mandatory locking
@ 2014-04-27 15:35 Michael Kerrisk (man-pages)
  2014-04-28 10:07 ` Jeff Layton
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Kerrisk (man-pages) @ 2014-04-27 15:35 UTC (permalink / raw)
  To: Linux-Fsdevel
  Cc: mtk.manpages, Jeff Layton, Neil Brown, Theodore T'so,
	Christoph Hellwig, Andy Lutomirski

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-29  5:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-27 15:35 Status of fcntl() mandatory locking Michael Kerrisk (man-pages)
2014-04-28 10:07 ` Jeff Layton
2014-04-29  5:21   ` Michael Kerrisk (man-pages)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).