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: Maybe 1.5 Regression: cp failing while working with cygwin 1.3.22


On Jan 15 15:03, Corinna Vinschen wrote:
> On Jan 15 13:21, Roland Schwingel wrote:
> > [...]
> > 11. cp -rp //server/share/path/to/your/home/tmp/test /tmp
> > 12. Error message appears:
> >
> > cp: will not create hard link: '/tmp/test/symlink' to directory 
> > '/tmp/test/subdir'
> >
> > Obviously cygwin 1.5 is now detecting the symlink correctly while 1.3 was 
> > not because it copied
> > the symlinked folder as folder not as link (even when I did cp -a).
> 
> Cygwin 1.5.25 uses the i-node numbers returned by
> Samba > 3.x as ... i-node numbers.  Cygwin 1.3.x generated always pseudo
> i-node numbers on remote drives.
> [...]
> cygwin-1.5.25$ ls -li
> total 0
> 8808978157900 drwxr-xr-x 1 corinna root 0 Jan 15 14:46 subdir
> 8808978157900 drwxr-xr-x 1 corinna root 0 Jan 15 14:46 symlink
> [...]
> I have no idea why Samba doesn't return the correct i-node number for
> symlinks.  This is most unfortunate.

A look into the Samba source code shows why.  Samba always calls stat(2)
on files if the client is a Windows client.  It uses lstat(2) only for
UNIX CIFS clients.  That explains the identical i-node numbers in Cygwin.
Sigh, a bit more intelligence would have been nice :(

Eric, maybe cp(1) can be pushed up a bit by checking the number of
hardlinks on the file?  Two files with identical i-nodes are only
actually hardlinks to the same file if the number of links is equal
and > 1?


Corinna

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

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


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