git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Dmitry Potapov <dpotapov@gmail.com>,
	Sitaram Chamarty <sitaramc@gmail.com>,
	git@vger.kernel.org,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: what's the current wisdom on git over NFS/CIFS?
Date: Fri, 3 Jul 2009 09:08:08 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0907030858540.3210@localhost.localdomain> (raw)
In-Reply-To: <4A4DCCDD.9030901@viscovery.net>



On Fri, 3 Jul 2009, Johannes Sixt wrote:
> 
> Do we ever call fsync on a pipe? In this case, fsync should fail with
> EINVAL, but your implementation would wait until the reader has drained
> all data.

I'm pretty sure we never call fsync() on anything but a file. So I suspect 
the patch for windows is fine - it only needs to care about regular files.

That said, there's a reason we don't enable fsync by default - it's 
generally not needed. I'm not sure what the NTFS crash semantics are, but 
I _think_ NTFS does everything with a proper log, and then fsync probably 
doesn't matter on windows.

The "fsync on CIFS" was not about "windows is crap, and because it's a 
windows filesystem we need to fsync" - it was literally because there was 
a bug in the Linux CIFS implementation that meant that pending writes 
could be lost if the file was made read-only while they were still 
pending.

And on non-journaling filesystems, fsync is obviously a good idea, but 
even then the state is often recoverable even in the face of a crash. Now, 
without fsync, you might have to work at it a bit and know what to do - 
like _manually_ resetting to the previous state and re-doing the last 
corrupt commit, throwing out any corrupt objects etc.

So enabling fsync can make things _much_ easier for recovery (to the point 
of making it possible at all for somebody who doesn't know the git object 
model), but is generally not a hard requirement.

Giving windows git the capability to do it sounds like a good idea, 
though.

Keep in mind: enabling fsync _will_ make object creation slower. Most 
people probably won't care much, though. It really only matters under some 
fairly rare circumstances - I care, beause it matters for things like 
"apply 200 patches in one go as fast as you can", but for most 'normal' 
workflows you'd probably never even notice.

			Linus

      reply	other threads:[~2009-07-03 16:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-02 13:11 what's the current wisdom on git over NFS/CIFS? Sitaram Chamarty
2009-07-02 13:58 ` Martin Langhoff
2009-07-02 14:00   ` Martin Langhoff
2009-07-02 20:58 ` Linus Torvalds
2009-07-03  0:52   ` Sitaram Chamarty
2009-07-03  6:14     ` Johannes Sixt
2009-07-03  6:37       ` Sitaram Chamarty
2009-07-03  8:56       ` Dmitry Potapov
2009-07-03  9:18         ` Johannes Sixt
2009-07-03 16:08           ` Linus Torvalds [this message]

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=alpine.LFD.2.01.0907030858540.3210@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=dpotapov@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    --cc=sitaramc@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).