Skip to content
Snippets Groups Projects
  1. Nov 15, 2010
  2. Nov 13, 2010
  3. Nov 10, 2010
  4. Nov 12, 2010
  5. Nov 10, 2010
  6. Nov 09, 2010
  7. Nov 07, 2010
  8. Nov 10, 2010
  9. Nov 08, 2010
  10. Nov 07, 2010
  11. Nov 08, 2010
  12. Nov 07, 2010
    • Adrian Buehlmann's avatar
      opener: check hardlink count reporting (issue1866) · bf826c0b
      Adrian Buehlmann authored
      The Linux CIFS kernel driver (even in 2.6.36) suffers from a hardlink
      count blindness bug (lstat() returning 1 in st_nlink when it is expected
      to return >1), which causes repository corruption if Mercurial running
      on Linux pushes or commits to a hardlinked repository stored on a Windows
      share, if that share is mounted using the CIFS driver.
      
      This patch works around issue1866 and improves the workaround done in
      50523b4407f6 to fix issue761, by teaching the opener to lazily execute a
      runtime check (new function checknlink) to see if the hardlink count
      reported by nlinks() can be trusted.
      
      Since nlinks() is also known to return varying count values (1 or >1)
      depending on whether the file is open or not and depending on what client
      and server software combination is being used for accessing and serving
      the Windows share, we deliberately open the file before calling nlinks() in
      order to have a stable precondition. Trying to depend on the precondition
      "file closed" would be fragile, as the file could have been opened very
      easily somewhere else in the program.
      bf826c0b
  13. Nov 04, 2010
    • Adrian Buehlmann's avatar
      util: refactor opener · 6ff784de
      Adrian Buehlmann authored
      - Don't call atomictempfile or nlinks() if the path is malformed
        (no basename). Let posixfile() raise IOError directly.
      - atomictempfile already breaks up hardlinks, no need to poke
        at the file with nlinks() if atomictemp.
      - No need to copy the file contents to break hardlinks for 'w'rite
        modes (w, wb, w+, w+b). Unlinking and recreating the file is faster.
      6ff784de
  14. Nov 05, 2010
  15. Nov 01, 2010
  16. Oct 31, 2010
  17. Oct 30, 2010
Loading