Re: [PATCH v2] sha1_file.c:create_tmpfile(): Fix race when creating loose object dirs

2013-10-30 Thread Jeff King
On Wed, Oct 30, 2013 at 05:19:27AM -0400, Jeff King wrote: > > To achieve this, I guess we have to follow the same procedure we do for > > loose object creation: > > > > 1. Create a temporary directory with a unique name (mkdtemp?) > > > > 2. Adjust permissions > > > > 3. Rename into place >

Re: [PATCH v2] sha1_file.c:create_tmpfile(): Fix race when creating loose object dirs

2013-10-30 Thread Jeff King
On Sun, Oct 27, 2013 at 12:35:43PM +0100, Johan Herland wrote: > I didn't see this in the latest "What's cooking", so here's a resend, with > an expanded commit message to reflect our discussion. The patch itself is > unchanged. Thanks, your expanded description looks correct to me. > In order t

[PATCH v2] sha1_file.c:create_tmpfile(): Fix race when creating loose object dirs

2013-10-27 Thread Johan Herland
There are cases (e.g. when running concurrent fetches in a repo) where multiple Git processes concurrently attempt to create loose objects within the same objects/XX/ dir. The creation of the loose object files is (AFAICS) safe from races, but the creation of the objects/XX/ dir in which the loose