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

Re: Explanation for dropping write-back in mmap

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 7, 2010, 15:55 UTC
Message-ID
<7vbpbmx2er.fsf@alter.siamese.dyndns.org>
In-Reply-To
<AANLkTilrinkNo9awJ9Wso4tXzQKghWEd2bfDRhPHPOga@mail.gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 12 quoted lines
> In the commit f48000fcbe100, you've forced the caller to use
> MAP_PRIVATE in the alternative mmap implementation dropping write-back
> support.
> ...
> commit f48000fcbe1009c18f1cc46e56cde2cb632071fa
> Author: Junio C Hamano <junkio@cox.net>
> Date:   Sat Oct 8 15:54:36 2005 -0700
>
>     Yank writing-back support from gitfakemmap.
>
>     We do not write through our use of mmap(), so make sure callers pass
>     MAP_PRIVATE and remove support for writing changes back.
That's a 

I don't think we _dropped_ a _working_ support that allowed shared mapping. IIRC the implementation emulated only private mapping well enough to support the use of mmap() in our codebase (iow, instead of allocating a buffer and reading into it and possibly mucking with it without affecting outside world, map it to read and then possibly mucking with it), but lacked input validation to make sure that no caller mistakenly thinks the implementation could satisfy non private mapping.

Also I don't think I did this without telling other people---it would be a lot more likely that somebody else noticed it and the issue was discussed on the list and resulted in this commit. I would check the commit date and see the discussion around that time if I were you to learn the backstory.

Previous: Shawn O. PearceNext: Ramkumar Ramachandra
Message 3 of 5 in “Explanation for dropping write-back in mmap”
  1. Ramkumar RamachandraJun 7, 2010
  2. Shawn O. PearceJun 7, 2010
  3. Junio C HamanoJun 7, 2010
  4. Ramkumar RamachandraJun 7, 2010
  5. David Michael BarrJun 7, 2010

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.