git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Kristian Høgsberg" <krh@redhat.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Fix config lockfile handling.
Date: Fri, 14 Dec 2007 13:57:59 -0800	[thread overview]
Message-ID: <7vfxy5os60.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1197665998-32386-2-git-send-email-krh@redhat.com> (Kristian Høgsberg's message of "Fri, 14 Dec 2007 15:59:57 -0500")

Kristian Høgsberg <krh@redhat.com> writes:

> When we commit or roll back the lock file the fd is automatically closed,
> so don't do that again.

With your change, we do not check the return status from close(2)
anymore, which means that we may have run out of diskspace without
noticing and renamed the incomplete file into the real place.  Oops?

At least the original code wouldn't have had that problem.

The right fix in the longer term would be to check the return value from
the close(2) in commit_lock_file(), but it currently does not check on
purpose, because the callers may have already closed the fd.

  parent reply	other threads:[~2007-12-14 21:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-14 20:59 config.c fixes, take 2 Kristian Høgsberg
2007-12-14 20:59 ` [PATCH] Fix config lockfile handling Kristian Høgsberg
2007-12-14 20:59   ` [PATCH] Use a strbuf for building up section header and key/value pair strings Kristian Høgsberg
2007-12-14 21:57   ` Junio C Hamano [this message]
2007-12-17 16:24     ` [PATCH] Fix config lockfile handling Kristian Høgsberg

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=7vfxy5os60.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=krh@redhat.com \
    /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).