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

Re: [HELP] Corrupted repository

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jun 23, 2013, 17:48 UTC
Message-ID
<vpqwqpk4t26.fsf@anie.imag.fr>
In-Reply-To
<7vzjujl267.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 20 quoted lines
> Ramkumar Ramachandra <artagnon@gmail.com> writes:
>
>> Junio C Hamano wrote:
>>>>   $ ~/src/git
>>>>   error: object file
>>>> .git/objects/8e/6a6dda24b017915449897fcc1353a9b848fd2f is empty
>>>>   error: object file
>>>> .git/objects/8e/6a6dda24b017915449897fcc1353a9b848fd2f is empty
>>>>   fatal: loose object 8e6a6dda24b017915449897fcc1353a9b848fd2f (stored
>>>> in .git/objects/8e/6a6dda24b017915449897fcc1353a9b848fd2f) is corrupt
>>>
>>> So fsync() and close() thought that the filesystem stored this loose
>>> object safely, but it turns out that the data is not on disk.
>>
>> Where should I start digging if I want to fix this?  Actually you just
>> need to tell me how to build reduced-case corruptions to test: I can
>> trace and figure out the rest.
>
> That is a trip in the kernel source, isn't it?  I cannot be your
> guide there.

Not necessarily. AFAICT, Git won't fsync object files by default, but does for pack files (to make sure the pack is written before unlinking the object files being packed):

       core.fsyncobjectfiles
           This boolean will enable fsync() when writing object files.
           This is a total waste of time and effort on a filesystem that
           orders data writes properly, but can be useful for
           filesystems that do not use journalling (traditional UNIX
           filesystems) or that only journal metadata and not file
           contents (OS X’s HFS+, or Linux ext3 with "data=writeback").
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Ramkumar Ramachandra
Message 6 of 6 in “[HELP] Corrupted repository”
  1. Ramkumar RamachandraJun 21, 2013
  2. Junio C HamanoJun 21, 2013
  3. Ramkumar RamachandraJun 21, 2013
  4. Junio C HamanoJun 21, 2013
  5. Ramkumar RamachandraJun 21, 2013
  6. Matthieu MoyJun 23, 2013

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.