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

Re: [ANNOUNCE] CGit v0.1-pre

From
LHLars Hjemli <hjemli@gmail.com>
Date
Dec 11, 2006, 18:38 UTC
Message-ID
<8c5c35580612111038u480b1f95xdb7cf1b3b8fd97b@mail.gmail.com>
In-Reply-To
<Pine.LNX.4.64.0612111016220.12500@woody.osdl.org>
On 12/11/06, Linus Torvalds <torvalds@osdl.org> wrote:
Show 30 quoted lines
>
>
> On Mon, 11 Dec 2006, Lars Hjemli wrote:
> >
> > Ok. Code speeks louder than words, so I'll blatantly paste the key functions:
>
> Yeah, they're still buggy:
>
> > int cache_unlock(struct cacheitem *item)
> > {
> >       close(item->fd);
> >       return (rename(fmt("%s.lock", item->name), item->name) == 0);
> > }
> ...
> >       if (!cache_exist(item)) {
> >               if (!cache_lock(item)) {
> >                       sleep(1);
> >                       goto top;
> >               }
> >               if (!cache_exist(item))
> >                       cgit_fill_cache(item);
> >               cache_unlock(item);
>
> What do you think happens if that last "cache_exist()" returned true?
>
> That's right: the "cache_unlock()" will now OVERWRITE the valid cache with
> the (empty) lock-file that you didn't fill in.
>
> Oops.
>
Wow, that's embarrassing.
Thanks for the debugging, I'll try to actually fix it this time :-)
Previous: Linus TorvaldsNext: Jakub Narebski
Message 11 of 12 in “[ANNOUNCE] CGit v0.1-pre”
  1. Lars HjemliDec 10, 2006
  2. Jakub NarebskiDec 11, 2006
  3. MichaelDec 11, 2006
  4. Linus TorvaldsDec 11, 2006
  5. Lars HjemliDec 11, 2006
  6. Lars HjemliDec 11, 2006
  7. Linus TorvaldsDec 11, 2006
  8. Linus TorvaldsDec 11, 2006
  9. Lars HjemliDec 11, 2006
  10. Linus TorvaldsDec 11, 2006
  11. Lars HjemliDec 11, 2006
  12. Jakub NarebskiDec 11, 2006

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.