git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: broken repo after power cut

From
Richard Weinberger <richard@nod.at>
Date
Jun 21, 2015, 14:08 UTC
Message-ID
<5586C54F.1090705@nod.at>
In-Reply-To
<20150621135903.GA18719@infradead.org>
Am 21.06.2015 um 15:59 schrieb Christoph Hellwig:
Show 10 quoted lines
> 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

Previous: Christoph HellwigNext: Theodore Ts'o
Message 5 of 8 in “broken repo after power cut”
  1. Richard WeinbergerJun 20, 2015
  2. Johannes SchindelinJun 21, 2015
  3. Richard WeinbergerJun 21, 2015
  4. Christoph HellwigJun 21, 2015
  5. Richard WeinbergerJun 21, 2015
  6. Theodore Ts'oJun 22, 2015
  7. Richard WeinbergerJun 22, 2015
  8. Theodore Ts'oJun 22, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.