title: open O_CREAT | O_EXCL on NFS in Linux?
body: <p>When in the Linux 2.6 kernel and in NFSv3 did <code>open("fname", O_CREAT|O_EXCL)</code> became valid?  The current canonical <code>open(2)</code> system call documentation (<a href="http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html" rel="nofollow noreferrer">http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html</a>) says everything is fine:</p>
  
  <pre><code>  - O_EXCL  
     - ...  
        On NFS, O_EXCL is only supported when using NFSv3 or later on kernel  
        2.6 or later.  In NFS environments where O_EXCL support is not  
        provided, programs that rely on it for performing locking tasks will  
        contain a race condition.  Portable programs that want to perform  
        atomic file locking using a lockfile, and need to avoid reliance on NFS  
        support for O_EXCL, can  ...
  </code></pre>
  
  <p>This reads as though all 2.6 kernels are OK, but the man page <strong><a href="http://www.kernel.org/doc/man-pages/changelog.html#release_2.75" rel="nofollow noreferrer">changelog</a></strong> (ca late kernel 2.6.23) begins indicating validity <em>four years</em> after 2.6.0 went live, and the web is rife with boards users censuring this use within the last year or two.  I'd like to use this setup on RHEL 5 (2.6.18) systems, but I couldn't pin down when it truly became safe.  Does anyone have a definitive answer?</p>