From: "Lars Hjemli" <hjemli@gmail.com>
To: "Linus Torvalds" <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: Re: [ANNOUNCE] CGit v0.1-pre
Date: Mon, 11 Dec 2006 19:38:57 +0100 [thread overview]
Message-ID: <8c5c35580612111038u480b1f95xdb7cf1b3b8fd97b@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0612111016220.12500@woody.osdl.org>
On 12/11/06, Linus Torvalds <torvalds@osdl.org> wrote:
>
>
> 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 :-)
--
prev parent reply other threads:[~2006-12-11 18:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-10 23:42 [ANNOUNCE] CGit v0.1-pre Lars Hjemli
2006-12-11 0:08 ` Jakub Narebski
[not found] ` <8c5c35580612101616g179715ecyd02fcbb023246ecc@mail.gmail.com>
2006-12-11 0:29 ` Jakub Narebski
2006-12-11 13:37 ` Michael
2006-12-11 1:04 ` Linus Torvalds
2006-12-11 8:33 ` Lars Hjemli
2006-12-11 11:59 ` Lars Hjemli
2006-12-11 17:01 ` Linus Torvalds
2006-12-11 17:33 ` Linus Torvalds
2006-12-11 17:40 ` Lars Hjemli
2006-12-11 18:18 ` Linus Torvalds
2006-12-11 18:38 ` Lars Hjemli [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8c5c35580612111038u480b1f95xdb7cf1b3b8fd97b@mail.gmail.com \
--to=hjemli@gmail.com \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).