[sshfs] [darcs-users] darcs on sshfs

Miklos Szeredi miklos at szeredi.hu
Wed Sep 13 05:49:08 UTC 2006


> > I tried using sshfs to see if I could get around it, but had no luck:
> 
> >  darcs: takeLock /home/magnusth/tmp/rem_darcs/_darcs/lock in /home/magnusth/tmp/rem_darcs: atomic_create /home/magnusth/tmp/rem_darcs/_darcs/lock in /home/magnusth/tmp/rem_darcs: unsupported operation (Function not implemented)
> 
> export DARCS_SLOPPY_LOCKS=1
> 
> Note that running Darcs over sshfs is not supported by the Darcs
> developers.  In particular, accessing the same repository from
> multiple instances of Darcs over sshfs might or might not eat your
> files.
> 
> > If someone knows enough about sshfs to explain why this happens at all,
> > and if it can be fixed, I'd love to hear it. :-)
> 
> Darcs takes a lockfile when accessing a repository for writing.  There
> are two strategies for doing that:
> 
>  (1) use the link system call;
>  (2) use open(O_CREAT | O_EXCL).
> 
> (1) is safe over NFS, but only works on Unix filesystems.  (2) works
> on all filesystems, but is unsafe on NFSv2 and some implementations of
> NFSv3 (notably Linux before 2.6.5).
> 
> Hence, Darcs normally uses strategy (1) on Unix, and (2) on Windows.
> DARCS_SLOPPY_LOCKS forces Darcs to use strategy (1).
> 
> (Actually, this is a slight simplification: if Darcs detects a
> non-Unix filesystem on Linux or Mac OS X, it will automatically
> fall-back to strategy (2).)
> 
> Using DARCS_SLOPPY_LOCKS over sshfs might or might not be safe,
> depending on how sshfs is implemented.

Strategy (1) simply won't work, since there's no LINK call in sftp.

Strategy (2) will work and is safe as long as these minimum versions
are provided:

sshfs >= 1.3
fuse >= 2.5.0
linux >= 2.6.15

Otherwise it will appear to work but will be unsafe, like NFSv2/v3.

Miklos




More information about the darcs-users mailing list