Re: [PATCH 1/2] worktree: fix worktree add race.
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Feb 17, 2019, 07:05 UTC
- Message-ID
- <CAPig+cQCw-7WALdzdFD--Jt5d+iZbY8DBBQdC_P8wZ9CVTYZKA@mail.gmail.com>
- In-Reply-To
- <xmqq8syg6foq.fsf@gitster-ct.c.googlers.com>
On Fri, Feb 15, 2019 at 1:59 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> Michal Suchanek <msuchanek@suse.de> writes: > > Git runs a stat loop to find a worktree name that's available and then does > > mkdir on the found name. Turn it to mkdir loop to avoid another invocation of > > worktree add finding the same free name and creating the directory first. > > Yeah, relying on the atomicity of mkdir(2) is much saner approach > than "check -- ah we can use the name -- try to create" that is race > prone.
Yep. When you re-roll, please mention [1] in the cover letter or in the commentary section of this patch (after the "---" line below your sign-off) to provide context to reviewers. Also, when re-rolling, please Cc: people involved in that earlier discussion (whom I've added to the Cc: of this reply). Thanks.
[1]: http://public-inbox.org/git/CAPig+cSdpq0Bfq3zSK8kJd6da3dKixK7qYQ24=ZwbuQtsaLNZw@mail.gmail.com/