On Wed, Jun 11, 2008 at 01:47:18AM +0000, Linus Torvalds wrote: > > This consolidates the common operations for closing the new temporary file > that we have written, before we move it into place with the final name. > > There's some common code there (make it read-only and check for errors on > close), but more importantly, this also gives a single place to add an > fsync_or_die() call if we want to add a safe mode. > > This was triggered due to Denis Bueno apparently twice being able to > corrupt his git repository on OS X due to an unlucky combination of kernel > crashes and a not-very-robust filesystem. Could this be the source of a problem we often meet at work ? Let me try to describe it. We work with our git repositories (storages I should say) on NFS homes, with workdirs on a local directory (NFS homes are backuped daily, hence everything commited get backuped, and developers have shorter compilation times thanks to the local FS). I don't think the workdir use is relevant because I use it almost the same without NFS and haven't any issues, but I mention it just in case. Quite often, when people commit, they have corrupt repositories. The symptom is a `cannot read <sha1>` error message (or many at times). The usual way to "fix" it is to git fsck, and git reset (because after the fsck the index is totally screwed and all local files are marked new), and usually everything is fine then. This is not really a hard corruption, and it's really hard to reproduce, I don't know why it happens, and I wonder if this patch could help, or if it's unrelated. I can only bring speculations as it's really hard to reproduce, and it quite depends on the load of the NFS server :/ -- ·O· Pierre Habouzit ··O madcoder@xxxxxxxxxx OOO http://www.madism.org
Attachment:
pgpof6LIaATFd.pgp
Description: PGP signature