git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Sitaram Chamarty <sitaramc@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: what's the current wisdom on git over NFS/CIFS?
Date: Thu, 2 Jul 2009 13:58:25 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0907021345440.3210@localhost.localdomain> (raw)
In-Reply-To: <slrnh4pcf8.484.sitaramc@sitaramc.homelinux.net>



On Thu, 2 Jul 2009, Sitaram Chamarty wrote:
> 
> A couple of us were beating each other senseless on this
> issue over on #git, so I thought I'd ask: is it OK to do
> this?  Or would there potential be race conditions due to
> the lack of proper locking?

It should all work fine.

We've had a few NFS issues due to oddities with renaming across 
directories, but modern git avoids the cross-directory renames, and that 
whole issue only hit some very specific cases anyway.

And git doesn't have "proper locking", because it doesn't need it for 
database ops: git objects are stable. For refs, git should be using the 
proper NFS-safe "create and atomic rename" ops.

You do need to be a bit careful if you do maintenance operations 
concurrently (I would suggest avoiding doing concurrent "git gc --prune", 
for example), but any normal git workflow should be fine.

There is one big thing to look out for: performance. You may want to add

	[core]
		PreloadIndex = true

in your .git/config file, especially if you have a high-latency NFS server 
(but if you have a fast network and a high-end NFS server, you might be 
better off without it, so do your own testing).

Btw, I think we fixed the problem we had with CIFS. That one was a cifs 
filesystem problem on Linux, but it should be fixed in 2.6.30+ (commit 
0f4d634c: "cifs: flush data on any setattr"). If you have an older kernel 
(or are just uncertain), you can also work around it with

	[core]
		fsyncobjectfiles = true

which may be a good thing in general (regardless of any cifs issues), but 
in most cases the performance loss isn't worth it if your filesystem is 
stable and sane.

			Linus

  parent reply	other threads:[~2009-07-02 20:58 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 [this message]
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

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.0907021345440.3210@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=git@vger.kernel.org \
    --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).