From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <stefanbeller@gmail.com>
Cc: Stefan Beller <sbeller@google.com>,
git@vger.kernel.org, Loic Dachary <loic@dachary.org>
Subject: Re: git update-ref --stdin : too many open files
Date: Tue, 23 Dec 2014 07:57:35 -0800 [thread overview]
Message-ID: <xmqq38865pg0.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <5498D66B.5090807@gmail.com> (Stefan Beller's message of "Mon, 22 Dec 2014 18:41:47 -0800")
Stefan Beller <stefanbeller@gmail.com> writes:
> Sounds reasonable. Though by closing the file we're giving up again a
> bit of safety. If we close the file everyone could tamper with the lock
> file. (Sure they are not supposed to touch it, but they could)
There are locking primitives (SysV mandatory locking) that require
you to keep the file you have lock on open for you to retain the
ownership of the lock, and that kind of lock does prevent random
other processes from simultaneously accessing the locked file.
But that is not what our locks are designed around; our locks rely
only on "open(O_EXCL|O_CREAT) fails if it already exists". And
between keeping a lockfile open and closing but not removing a
lockfile, there is no difference how the lockfile that still exists
prevents open(O_EXCL|O_CREAT) by other processes from succeeding.
So we are not giving up any safety at all, which is a good thing ;-).
next prev parent reply other threads:[~2014-12-23 15:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-20 10:24 git update-ref --stdin : too many open files Loic Dachary
2014-12-22 21:22 ` Junio C Hamano
2014-12-23 2:41 ` Stefan Beller
2014-12-23 3:22 ` Jonathan Nieder
2014-12-23 15:57 ` Junio C Hamano [this message]
2014-12-24 2:11 ` Stefan Beller
2014-12-29 1:28 ` Michael Haggerty
2014-12-29 22:56 ` Stefan Beller
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=xmqq38865pg0.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=loic@dachary.org \
--cc=sbeller@google.com \
--cc=stefanbeller@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.