git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Verdoolaege <skimo@kotnet.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] lockfile.c: schedule remove_lock_file only once.
Date: Sun, 15 Jul 2007 10:35:21 +0200	[thread overview]
Message-ID: <20070715083521.GB999MdfPADPa@greensroom.kotnet.org> (raw)
In-Reply-To: <7vabu0noxg.fsf@assigned-by-dhcp.cox.net>

On Fri, Jul 13, 2007 at 11:23:07AM -0700, Junio C Hamano wrote:
> The reason we do not use lk->next but instead check lk->on_list,
> and the reason why we do not remove the lock from the list, are
> described in 1084b845.

I'm afraid I'm still missing something:

1084b845 commit message:
    We cannot remove the list element in commit_lock_file(); if we
    are interrupted in the middle of list manipulation, the call to
    remove_lock_file_on_signal() will happen with a broken list
    structure pointed by lock_file_list, which would cause the cruft
    to remain, so not removing the list element is the right thing
    to do.  Instead we should be reusing the element already on the
    list.

We have a list

list--->A--->B--->C

and we overwrite one next pointer to remove an element, say B

list--->A-------->C

At what point is the list structure broken?

If you are worried that the interrupt could happen in the middle
of writing the pointer (could it?), then shouldn't you worry
about adding elements too?

skimo

      reply	other threads:[~2007-07-15  8:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-13 14:14 [PATCH] lockfile.c: schedule remove_lock_file only once Sven Verdoolaege
2007-07-13 18:23 ` Junio C Hamano
2007-07-15  8:35   ` Sven Verdoolaege [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=20070715083521.GB999MdfPADPa@greensroom.kotnet.org \
    --to=skimo@kotnet.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=skimo@liacs.nl \
    /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).