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

Re: [PATCH] fsck: do not loop infinitely when processing packs

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Feb 22, 2026, 23:07 UTC
Message-ID
<aZuMPcMYwFi4Sch5@fruit.crustytoothpaste.net>
In-Reply-To
<xmqqv7fopflu.fsf@gitster.g>
On 2026-02-22 at 22:39:57, Junio C Hamano wrote:
Show 21 quoted lines
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
> 
> > diff --git a/t/t1050-large.sh b/t/t1050-large.sh
> > index 5be273611a..75e75e627c 100755
> > --- a/t/t1050-large.sh
> > +++ b/t/t1050-large.sh
> > @@ -160,6 +160,10 @@ test_expect_success 'hash-object' '
> >  	git hash-object large1
> >  '
> >  
> > +test_expect_success 'fsck does not loop forever' '
> > +	git fsck
> > +'
> > +
> >  test_expect_success 'cat-file a large file' '
> >  	git cat-file blob :large1 >/dev/null
> >  '
> 
> Wow, this is a fun test ;-).
> 
> Thanks.  Will queue.

I noticed that the code here seems to have come in with the 2.53 cycle, so we may want to cherry-pick it to `maint` at some point if it seems like the problem occurs often. From what I can tell, it only occurs when one explicitly invokes `git fsck`[0] and not on transfer, so it shouldn't cause a DoS against server implementations.

Of course, we should wait for Patrick, who authored this code, to chime in and lend his expertise here. I must admit I'm not very familiar with this area, although I had recently seen the MRU code when working on pack index v3 (and then I thought, "is this actually the problem?").

[0] The code I saw is the `if (check_full)` branch in `cmd_fsck`, which is obviously only invoked by the `fsck` command itself.

-- 
brian m. carlson (they/them)
Toronto, Ontario, CA
Previous: Junio C HamanoNext: Jeff King
Message 3 of 14 in “fsck: do not loop infinitely when processing packs”
  1. fsck: do not loop infinitely when processing packsbrian m. carlson, Feb 22, 2026
  2. Junio C HamanoFeb 22, 2026
  3. brian m. carlsonFeb 22, 2026
  4. Jeff KingFeb 23, 2026
  5. Patrick SteinhardtFeb 23, 2026
  6. Jeff KingFeb 23, 2026
  7. Patrick SteinhardtFeb 23, 2026
  8. Jeff KingFeb 23, 2026
  9. Junio C HamanoFeb 23, 2026
  10. Patrick SteinhardtFeb 23, 2026
  11. Jeff KingFeb 23, 2026
  12. Patrick SteinhardtFeb 23, 2026
  13. brian m. carlsonFeb 24, 2026
  14. Junio C HamanoFeb 24, 2026

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.