From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: broken repo after power cut Date: Sun, 21 Jun 2015 06:59:03 -0700 Message-ID: <20150621135903.GA18719@infradead.org> References: <5585C1B6.50407@nod.at> <330ab8f498e1b435d5b210384200b649@www.dscho.org> <5586B71D.2070407@nod.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Johannes Schindelin , git@vger.kernel.org, David Gstir , linux-fsdevel , Theodore Ts'o To: Richard Weinberger Return-path: Content-Disposition: inline In-Reply-To: <5586B71D.2070407@nod.at> Sender: git-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sun, Jun 21, 2015 at 03:07:41PM +0200, Richard Weinberger wrote: > >> To me it seems like git was creating a new object and got interrupted > >> before fsync/fdatasync'ing it. > >> As the object was referenced before syncing the data to disk the repo broke. Git doesn't fsync by default, and because of that I've seen similar data losses on ext4/xfs/btrfs. You can set the core.fsyncobjectfiles to mitigate it, but even with that I've seen corrupted index files. Note that I've been mostly on old git versions from various distros, so in case this was fixed recently I'll take everything I said back.