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

Re: Probably a GIT bug..

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Apr 23, 2008, 17:13 UTC
Message-ID
<20080423171355.GE26950@dpotapov.dyndns.org>
In-Reply-To
<7v63u8tt62.fsf@gitster.siamese.dyndns.org>
On Wed, Apr 23, 2008 at 09:47:17AM -0700, Junio C Hamano wrote:
Show 6 quoted lines
> 
> That's a somewhat contrived example, and I do not know how you found it.
> 
> I suspect the same breakage would trigger when you ran out of disk quota
> to write out the tree while you still have barely enough quota to create
> the commit and update the ref, which would result in corrupt repository.

I have looked at write_sha1_file(), it appears to me that if you do not have enough disk space (or exceed your disk quote) then this function will die inside. For the described situation to happen, you probably should have wrong permissions on directories (as it was simulated in the bug report) or some other error with open() (such as exceeding the maximum allowed number of descriptor).

So I wonder why errors in write_sha1_file() are treated differently, i.e. the function may die on error in some error cases (such as not enough disk space), but it indicates the error situation by return code if open() failed.

BTW, the returned code of write_sha1_file() is also not checked in write_tree() in mktree.c.

Dmitry
Previous: Daniel Barkalow
Message 4 of 4 in “Probably a GIT bug..”
  1. Tomasz bla FortunaApr 22, 2008
  2. Junio C HamanoApr 23, 2008
  3. Daniel BarkalowApr 23, 2008
  4. Dmitry PotapovApr 23, 2008

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.