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

Re: [PATCH] Fix random fast-import errors when compiled with NO_MMAP

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jan 19, 2008, 03:55 UTC
Message-ID
<alpine.LFD.1.00.0801181953130.2957@woody.linux-foundation.org>
In-Reply-To
<7vwsq6a44w.fsf@gitster.siamese.dyndns.org>
On Fri, 18 Jan 2008, Junio C Hamano wrote:
Show 17 quoted lines
> 
> gfi uses data in a "pack" in two quite different ways.
> 
> A new object is written to an unfinalized pack.  Such a pack
> already has "struct packed_git" allocated for it and a pointer
> to it is held in pack_data.  As far as the core part of git
> (that is, sha1_file.c) is concerned, however, this pack does not
> even exist.  It is still not part of packed_git list in
> sha1_file.c, and read_sha1_file() will not see objects in it, as
> no idx into the packfile exists yet.  gfi has a table of objects
> in this pack and uses gfi_unpack_entry() function to retrieve
> data from it.
> 
> A packfile is finalized in end_packfile().  The pack header and
> footer is recomputed, an idx file is written, and the pack is
> finally registered.  Before that time p->index_data is not even
> used for that pack (it is initialized with NULL).

Oh, ok. I did try to grep for index_data, and didn't find anything that looked bad, but the incestuous things that fast-import.c does just made me worry - but I was too lazy to really follow it all. It's one of those files I don't think I've ever had anything what-so-ever to do with.

> So I do not think "index_data usage" can be incorrect, as there
> won't be any index_data usage with unfinalized pack, and the
> core part of git would not even have any mmap(2) (nor open fd)
> into its idx file before it is finalized.

In that case, I think Shawn fixed it all, and we're all good, and it's not just hidden well enough that it "just happens" to work.

				Linus
Previous: Junio C HamanoNext: Shawn O. Pearce
Message 5 of 13 in “Re: [PATCH] Fix random fast-import errors when compiled with NO_MMAP”
  1. Linus TorvaldsJan 18, 2008
  2. Charles BaileyJan 18, 2008
  3. Linus TorvaldsJan 18, 2008
  4. Junio C HamanoJan 19, 2008
  5. Linus TorvaldsJan 19, 2008
  6. Shawn O. PearceJan 21, 2008
  7. Junio C HamanoJan 18, 2008
  8. Shawn O. PearceJan 21, 2008
  9. Johannes SixtJan 18, 2008
  10. Charles BaileyJan 18, 2008
  11. Junio C HamanoJan 18, 2008
  12. Charles BaileyJan 18, 2008
  13. Junio C HamanoJan 18, 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.