git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Ephrim Khong <dr.khong@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH] merge-recursive: create new files with O_EXCL
Date: Thu, 11 Mar 2021 09:52:50 -0800	[thread overview]
Message-ID: <xmqqlfatefwt.fsf@gitster.g> (raw)
In-Reply-To: <cd7c6682-7409-f72c-8751-02b70a423f83@gmail.com> (Ephrim Khong's message of "Thu, 11 Mar 2021 10:54:41 +0100")

Ephrim Khong <dr.khong@gmail.com> writes:

>> I do not think we mind fixing the use of O_TRUNC with "remove and
>> then create with O_EXCL", but we'd probably want to
>> 
>>  * understand why only this place matters, or perhaps other uses of
>>    O_TRUNC needs the same fix to work "correctly" with your NFS
>>    mounts, in which case we'd need all of them addressed in the same
>>    series of patches, and
>
> I'd say that is up to you. Personally I'd rather err on the side of
> caution and leave the other code as is, especially since it is not
> really required for the file mode issue as described above.

OK.

Especially the other places are prepared to deal with a leftover
stale file, there is no reason to add extra cost to unlink before
recreating.  If we know this place we will never have an existing
file (because we unlinked), then TRUNC -> EXCL is a no-cost change
for us.

If some of these other places turn out to be problem for you and
other users who are affected by the same NFS mount problem, we may
need to replace these places' open(CREAT|TRUNC) with a wrapper that
conditionally does an unlink+open(CREAT|EXCL) with a Makefile knob.

But before doing any of that, we'd need to see ...

>>  * understand why your NFS mount is broken and give a better
>>    explanation as to why we need to have a workaround in our code.
>
> I'll work on this, but unfortunately have no idea of how to properly
> debug it. Since it is a company server without administrative rights and
> the backend is some IBM storage system, the options are limited and
> processes are slow. What I did find out so far is that it is not a race
> condition with unlink. A simple openat() without O_EXCL already produces
> the wrong file mode.

... this resolved, I would think.

Thanks.

  reply	other threads:[~2021-03-11 17:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10  7:57 [RFC PATCH] merge-recursive: create new files with O_EXCL Ephrim Khong
2021-03-10 23:01 ` Junio C Hamano
2021-03-11  9:54   ` Ephrim Khong
2021-03-11 17:52     ` Junio C Hamano [this message]
2021-03-11 18:01     ` Elijah Newren
2021-03-13  1:08     ` brian m. carlson

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqlfatefwt.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=dr.khong@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).