git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Jeff King <peff@peff.net>
Cc: "Duy Nguyen" <pclouds@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Git Mailing List" <git@vger.kernel.org>,
	"Kevin Willford" <kewillf@microsoft.com>
Subject: Re: [PATCH] reopen_tempfile(): truncate opened file
Date: Wed, 5 Sep 2018 20:48:34 +0200	[thread overview]
Message-ID: <20180905184834.ihpjardxnny6d54p@ltop.local> (raw)
In-Reply-To: <20180904233643.GA9156@sigill.intra.peff.net>

On Tue, Sep 04, 2018 at 07:36:43PM -0400, Jeff King wrote:
> On Tue, Sep 04, 2018 at 12:38:07PM -0400, Jeff King wrote:
> 
> > > And just to be clear I'm looking forward to a patch from Jeff to fix
> > > this since he clearly put more thoughts on this than me. With commit.c
> > > being the only user of reopen_lock_file() I guess it's even ok to just
> > > stick O_TRUNC in there and worry about O_APPEND when a new caller
> > > needs that.
> > 
> > That's the way I'm leaning to. The fix is obviously a one-liner, but I
> > was hoping to construct a minimal test case. I just haven't gotten
> > around to it yet.
> 
> It turned out not to be too bad to write a test. It feels a little like
> black magic, since I empirically determined a way in which the
> cache-tree happens to shrink with the current code. But that assumption
> is tested with a sanity check, so we'll at least know if it becomes a
> noop.
> 
> > The bug is ancient, so I don't think it's important for v2.19.
> 
> The patch below should work on master or maint. We could do a fix
> directly on top of the bug, but merging-up is weird (because the buggy
> code became part of a reusable module).

It's great that you were able to create a reproducer relatively easily.

Thank you, guys.

-- Luc 

      parent reply	other threads:[~2018-09-05 18:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-01 21:41 [BUG] index corruption with git commit -p Luc Van Oostenryck
2018-09-01 22:17 ` Ævar Arnfjörð Bjarmason
2018-09-02  5:08   ` Jeff King
2018-09-02  7:12     ` Duy Nguyen
2018-09-02  7:24       ` Jeff King
2018-09-02  7:53         ` Luc Van Oostenryck
2018-09-02  8:02           ` Jeff King
2018-09-04 15:57         ` Junio C Hamano
2018-09-04 16:13           ` Duy Nguyen
2018-09-04 16:38             ` Jeff King
2018-09-04 23:36               ` [PATCH] reopen_tempfile(): truncate opened file Jeff King
2018-09-05 15:27                 ` Duy Nguyen
2018-09-05 15:35                   ` Jeff King
2018-09-05 15:39                     ` Duy Nguyen
2018-09-05 15:48                       ` Jeff King
2018-09-05 16:54                         ` Junio C Hamano
2018-09-05 16:56                           ` Jeff King
2018-09-05 17:01                             ` Junio C Hamano
2018-09-05 18:48                 ` Luc Van Oostenryck [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=20180905184834.ihpjardxnny6d54p@ltop.local \
    --to=luc.vanoostenryck@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kewillf@microsoft.com \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    /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).