From: Jeff King Date: Thu, 05 Oct 2017 11:12:49 GMT Subject: Re: [PATCH v1 1/2] entry.c: update cache entry only for existing files Message-ID: <20171005111249.4fdezbjnysb6t2zm@sigill.intra.peff.net> In-Reply-To: <20171005104407.65948-2-lars.schneider@autodesk.com> On Thu, Oct 05, 2017 at 12:44:06PM +0200, lars.schneider@autodesk.com wrote: > From: Lars Schneider > > In 2841e8f ("convert: add "status=delayed" to filter process protocol", > 2017-06-30) we taught the filter process protocol to delay responses. > > That means an external filter might answer in the first write_entry() > call on a file that requires filtering "I got your request, but I > can't answer right now. Ask again later!". As Git got no answer, we do > not write anything to the filesystem. Consequently, the lstat() call in > the finish block of the function writes garbage to the cache entry. > The garbage is eventually overwritten when the filter answers with > the final file content in a subsequent write_entry() call. > > Fix the brief time window of garbage in the cache entry by adding a > special finish block that does nothing for delayed responses. The cache > entry is written properly in a subsequent write_entry() call where > the filter responds with the final file content. Nicely explained and the patch looks correct. I also verified that MSan is happy with t0021 after this. Thanks for the quick turnaround. -Peff