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

Re: [PATCH v4] compat: Fix read() of 2GB and more on Mac OS X

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 27, 2013, 04:59 UTC
Message-ID
<xmqq4nabhgpp.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CA+55aFzAQjxB7HkDqR6_3wdex1t1Tbrf5CeUVyiVm=DRyDVhhQ@mail.gmail.com>
Linus Torvalds <torvalds@linux-foundation.org> writes:
> So it would probably be a great idea to make the filtering code able
> to do things in smaller chunks, but I suspect that the patch to chunk
> up xread/xwrite is the right thing to do anyway.

Yes and yes, but the first yes is a bit tricky for writing things out, as the recipient of the filter knows the size of the input but not of the output, and both loose and packed objects needs to record the length of the object at the very beginning.

Even though our streaming API allows to write new objects directly to a packfile, for user-specified filters, CRLF, and ident can make the size of the output unknown before processing all the data, so the best we could do for these would be to stream to a temporary file and then copy it again with the length header (undeltified packed object deflates only the payload, so this "copy" can literally be a byte-for-byte copy, after writing the in-pack header out).

As reading from the object store and writing it out to the filesystem (i.e. entry.c::write_entry() codepath) does not need to know the output size, convert.c::get_stream_filter() might want to be told in which direction a filter is asked for and return a streaming filter back even when those filters that are problematic for the opposite, writing-to-object-store direction.

Previous: Linus TorvaldsNext: Steffen Prohaska
Message 26 of 37 in “xread(): Fix read error when filtering >= 2GB on Mac OS X”
  1. xread(): Fix read error when filtering >= 2GB on Mac OS XSteffen Prohaska, Aug 17, 2013
  2. John KeepingAug 17, 2013
  3. Torsten BögershausenAug 17, 2013
  4. Johannes SixtAug 17, 2013
  5. Jonathan NiederAug 17, 2013
  6. Kyle J. McKayAug 17, 2013
  7. Jonathan NiederAug 17, 2013
  8. compat: Fix read() of 2GB and more on Mac OS XSteffen Prohaska, Aug 19, 2013
  9. John KeepingAug 19, 2013
  10. Steffen ProhaskaAug 19, 2013
  11. Johannes SixtAug 19, 2013
  12. Stefan BellerAug 19, 2013
  13. Johannes SixtAug 19, 2013
  14. Steffen ProhaskaAug 19, 2013
  15. compat: Fix read() of 2GB and more on Mac OS XSteffen Prohaska, Aug 19, 2013
  16. Eric SunshineAug 19, 2013
  17. Junio C HamanoAug 19, 2013
  18. compat: Fix read() of 2GB and more on Mac OS XSteffen Prohaska, Aug 19, 2013
  19. Linus TorvaldsAug 19, 2013
  20. Steffen ProhaskaAug 19, 2013
  21. Junio C HamanoAug 19, 2013
  22. Junio C HamanoAug 19, 2013
  23. Linus TorvaldsAug 19, 2013
  24. Kyle J. McKayAug 19, 2013
  25. Linus TorvaldsAug 19, 2013
  26. Junio C HamanoAug 27, 2013
  27. 0/2 Fix IO of >=2GB on Mac OS X by limiting IO chunksSteffen Prohaska, Aug 20, 2013
  28. 1/2 xread, xwrite: Limit size of IO, fixing IO of 2GB and more on Mac OS XSteffen Prohaska, Aug 20, 2013
  29. Junio C HamanoAug 20, 2013
  30. Torsten BögershausenAug 21, 2013
  31. 2/2 Revert "compate/clipped-write.c: large write(2) fails on Mac OS X/XNU"Steffen Prohaska, Aug 20, 2013
  32. 0/2 Fix IO >= 2GB on Mac, fixed typoSteffen Prohaska, Aug 21, 2013
  33. 1/2 xread, xwrite: Limit size of IO, fixing IO of 2GB and more on Mac OS XSteffen Prohaska, Aug 21, 2013
  34. 2/2 Revert "compate/clipped-write.c: large write(2) fails on Mac OS X/XNU"Steffen Prohaska, Aug 21, 2013
  35. Junio C HamanoAug 21, 2013
  36. Johannes SixtAug 19, 2013
  37. Torsten BögershausenAug 19, 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.