From: Richard Weinberger Subject: Re: broken repo after power cut Date: Sun, 21 Jun 2015 16:08:15 +0200 Message-ID: <5586C54F.1090705@nod.at> References: <5585C1B6.50407@nod.at> <330ab8f498e1b435d5b210384200b649@www.dscho.org> <5586B71D.2070407@nod.at> <20150621135903.GA18719@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Johannes Schindelin , git@vger.kernel.org, David Gstir , linux-fsdevel , Theodore Ts'o To: Christoph Hellwig Return-path: Received: from a.ns.miles-group.at ([95.130.255.143]:65276 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751655AbbFUOIT (ORCPT ); Sun, 21 Jun 2015 10:08:19 -0400 In-Reply-To: <20150621135903.GA18719@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Am 21.06.2015 um 15:59 schrieb Christoph Hellwig: > 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. Yeah, after inspecting git's source I've found that config option too. Now it's also crystal clear that git is not power cut safe at all by default. ;-\ So, anyone that cares about his repos has to enable core.fsyncobjectfiles, which is IMHO kind of sad. Thanks, //richard -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in