From: Eric Sunshine <sunshine@sunshineco.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Michal Suchanek" <msuchanek@suse.de>,
"Git List" <git@vger.kernel.org>,
"Marketa Calabkova" <mcalabkova@suse.cz>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: Re: [PATCH 1/2] worktree: fix worktree add race.
Date: Sun, 17 Feb 2019 02:05:11 -0500 [thread overview]
Message-ID: <CAPig+cQCw-7WALdzdFD--Jt5d+iZbY8DBBQdC_P8wZ9CVTYZKA@mail.gmail.com> (raw)
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:
> 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/
next prev parent reply other threads:[~2019-02-17 7:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-15 18:16 [PATCH 1/2] worktree: fix worktree add race Michal Suchanek
2019-02-15 18:16 ` [PATCH 2/2] setup: don't fail if commondir is deleted Michal Suchanek
2019-02-17 7:14 ` Eric Sunshine
2019-02-18 8:54 ` Michal Suchánek
2019-02-15 18:59 ` [PATCH 1/2] worktree: fix worktree add race Junio C Hamano
2019-02-16 0:18 ` Michal Suchánek
2019-02-17 7:05 ` Eric Sunshine [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-02-18 17:04 [PATCH 0/2] worktree add race fix Michal Suchanek
2019-02-18 17:04 ` [PATCH 1/2] worktree: fix worktree add race Michal Suchanek
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=CAPig+cQCw-7WALdzdFD--Jt5d+iZbY8DBBQdC_P8wZ9CVTYZKA@mail.gmail.com \
--to=sunshine@sunshineco.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mcalabkova@suse.cz \
--cc=msuchanek@suse.de \
--cc=pclouds@gmail.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).