Status of fcntl() mandatory locking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux