This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problems with nfs


On Apr 25 09:39, Fedin Pavel wrote:
> On 24.04.2012 18:11, Corinna Vinschen wrote:
> 
> >An NFS client is a filesystem driver. There are companies
> >providing such NFS clients, one of them Microsoft with SFU on
> >pre-Vista and the NFS client in Vista/W7 Ultimate/Enterprise.
> >Corinna
> 
>  BTW, IIRC in Cygwin we can mount SMB/CIFS shares using 'smbfs' in
> the fstab. Why can't we do the same for NFS?

You can, and you didn't read the User's Manual.  See
http://cygwin.com/cygwin-ug-net/using.html#mount-table, fifth paragraph:

  The third field describes the type of the filesystem. Cygwin supports
  any string here, since the file system type is usually not evaluated.
  So it doesn't matter if you write FAT into this field even if the
  filesystem is NTFS. Cygwin figures out the filesystem type and its
  capabilities by itself.

I'm using NFS shares via Microsoft's NFS client all the time.  A typical
mount table entry looks like this:

  Y:/src /home/corinna/src foo binary 0 0

and the mount output for this looks like this:

  $ mount | grep src
  Y:/src on /home/corinna/src type nfs (binary,user)

So, again, just to be clear, the content of the third field in
/etc/fstab or /etc/fstab.d/$USER doesn't matter at all.  Cygwin doesn't
store it anywhere.  It figures out the FS type by itself, regardless
what's written in the fstab files.

>  And second point. Of course we can use SFU client, but there'll be
> one problem. It won't expose symlinks etc correctly, because it's
> Windows native thing.

How do you know?  Did you test it?  Did you have a look into the code?

Cygwin understands NFS symlinks just fine, and when it creates symlinks
on NFS, these are *real* symlinks, not Cygwin-type fake symlinks.  When
it recognizes SFU NFS shares, it uses special functionality provided by
the SFU NFS driver to read and create symlinks and to access file
metadata on these shares.

See here:
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/nfs.h?rev=1.2&content-type=text/x-cvsweb-markup&cvsroot=src
and here:
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/nfs.cc?rev=1.3&content-type=text/x-cvsweb-markup&cvsroot=src
and here:
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/fhandler_disk_file.cc?rev=1.376&content-type=text/x-cvsweb-markup&cvsroot=src 
(look for fhandler_base::fstat_by_nfs_ea(), fhandler_disk_file::fchmod(),
 fhandler_disk_file::mkdir(),  fhandler_disk_file::opendir(),
 fhandler_disk_file::readdir())
and here:
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/path.cc?rev=1.661&content-type=text/x-cvsweb-markup&cvsroot=src
(look for symlink_worker(), symlink_info::check_nfs_symlink(),
 symlink_info::check())


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]