Mercurial > hg
view doc/common.txt @ 12938:bf826c0b9537 stable
opener: check hardlink count reporting (issue1866)
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.
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Sun, 07 Nov 2010 18:21:29 +0100 |
parents | 2399362b3bb0 |
children |
line wrap: on
line source
.. Common link and substitution definitions. .. |hg(1)| replace:: **hg**\ (1) .. _hg(1): hg.1.html .. |hgrc(5)| replace:: **hgrc**\ (5) .. _hgrc(5): hgrc.5.html .. |hgignore(5)| replace:: **hgignore**\ (5) .. _hgignore(5): hgignore.5.html