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

Re: [PATCH 2/3] Support for partial HTTP transfers

From
NHNick Hengeveld <nickh@reactrix.com>
Date
Sep 27, 2005, 15:36 UTC
Message-ID
<20050927153636.GA1377@reactrix.com>
In-Reply-To
<7vfyrr3vwp.fsf@assigned-by-dhcp.cox.net>
On Mon, Sep 26, 2005 at 10:46:30PM -0700, Junio C Hamano wrote:
Show 18 quoted lines
> I think (O_CREAT|O_EXCL) in your code can be easily defeated by
> this sequence:
> 
>     one                 	two
> 
>     unlink prevfile
>     rename tmpfile, prevfile
>     unlink tmpfile
>     local = open tmpfile
>                                 unlink prevfile
>                                 rename tmpfile, prevfile
>                                 unlink tmpfile
>                                 local = open tmpfile
>                                 prevlocal = open prevfile
>     write local
>                                 copyfile prevlocal, local
>     write local
> 				???

The way I understand this sequence, one and two will not be writing to the same file. When two unlinks tmpfile, one will still be able to write to its local, but the body of the file that one is writing will be removed when it closes local.

Show 6 quoted lines
> Not that I think the multiple instances should be prevented at
> this low level --- if they stomp on each other at this level, it
> is very likely the they are doing duplicated work on the network
> side as well, and should be prevented from doing so at much
> higher level than this, I think.  That's why I said I do not
> mind BKL upfront in git-fetch.sh.
True, is that something I should include with the partial patch?
-- 
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 10 in “Support for partial HTTP transfers”
  1. 2/3 Support for partial HTTP transfersNick Hengeveld, Sep 26, 2005
  2. Junio C HamanoSep 26, 2005
  3. Nick HengeveldSep 27, 2005
  4. Junio C HamanoSep 27, 2005
  5. Nick HengeveldSep 27, 2005
  6. Junio C HamanoSep 27, 2005
  7. Nick HengeveldSep 27, 2005
  8. Junio C HamanoSep 27, 2005
  9. Daniel BarkalowSep 26, 2005
  10. sfSep 27, 2005

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.