Bug 2748 - ls shows wrong hardlink count and different inode numbers
Summary: ls shows wrong hardlink count and different inode numbers
Status: RESOLVED DUPLICATE of bug 2823
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: kernel fs (show other bugs)
Version: 2.6
Hardware: x86 Windows 2003
: P3 normal
Target Milestone: ---
Assignee: Steve French
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-28 13:17 UTC by Martin Koeppe
Modified: 2005-07-17 08:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Koeppe 2005-05-28 13:17:01 UTC
Hello,

I have 3 boxes, one with Win2003, one with Win2000 (with both SFU and Cygwin
installed), one with Linux 2.6.9+CIFS1.34.

Win2003 serves a share, say \\win2003\tmp.
I mount this share on Linux and on Win2000.

On the Linux box, if I create a file on the mounted share and then make 2
further hardlinks to it in the same directory, and then type "ls -lin", I get a
link count of 3 on the source file and a link count of 1 on the destination
files. Also the inode number is different for all 3 files.

After changing the directory to anything dfferent and then back, and redoing
"ls -lin", I get a link count of 1 for each of the 3 files, again with
different inode numbers.

The hardlinks are set up correctly, however, writing to one of it is reflected
in the others.

And if I change to the \\win2003\tmp mount on the Win2000 box and typing
"ls -lin" from Cygwin or from SFU, they show the correct link count and the
same inode number for the 3 links.

Here again what I did:

On Linux:
$ mount -t cifs //win2003/tmp /mnt
$ cd /mnt
$ rm file*
$ echo qwert > file1
$ ls -lin file*
5615 -rw-r--r--  1 0 0 6 2005-05-28 21:56 file1
$ ln file1 file2
$ ls -lin file*
5615 -rw-r--r--  1 0 0 6 2005-05-28 21:56 file1
5636 -rwxrwSrwt  1 0 0 6 2005-05-28 21:56 file2
$ ln file1 file3
$ ls -lin file*
5615 -rw-r--r--  3 0 0 6 2005-05-28 21:56 file1
5636 -rwxrwSrwt  1 0 0 6 2005-05-28 21:56 file2
5637 -rwxrwSrwt  1 0 0 6 2005-05-28 21:56 file3
$ echo 22222 >> file1
$ cat file1
qwert
22222
$ cat file2
qwert
22222
$ cat file3
qwert
22222
$ cd /
$ cd /mnt
$ ls -lin file*
5615 -rw-r--r--  1 0 0 12 2005-05-28 21:58 file1
5636 -rwxrwSrwt  1 0 0 12 2005-05-28 21:58 file2
5637 -rwxrwSrwt  1 0 0 12 2005-05-28 21:58 file3


Then on Windows 2000:
C:\>net use T: \\win2003\tmp
C:\>T:
T:\>ls -lin file*           <---- from Interix
60977 -rwx------+ 1 131616            1049089           12 May 28 21:58 file1
60977 -rwx------+ 1 131616            1049089           12 May 28 21:58 file2
60977 -rwx------+ 1 131616            1049089           12 May 28 21:58 file3

Within Cygwin:
$ ls -lin file*
12771340543265474077 -rw-r--r--    3 400      401       12 May 28 21:58 file1
12771340543265474078 -rw-r--r--    3 400      401       12 May 28 21:58 file2
12771340543265474079 -rw-r--r--    3 400      401       12 May 28 21:58 file3

So both Interix and Cygwin are buggy, too, as Interix shows the same inode
numbers, but wrong link count, and Cygwin has the right link count, but
different inode numbers.

But cifs is more buggy as it shows wrong link count and different inode numbers.
Also the permissions are not the same.
Comment 1 Martin Koeppe 2005-06-02 06:27:32 UTC
Hello,

today I found a partly solution to this problem.
When mounting with option "serverino" I get the correct inode
numbers (same as Interix reports). Link count is still wrong, however.
It's the same behaviour as with Interix in this regard.
Comment 2 Steve French 2005-07-17 08:06:27 UTC

*** This bug has been marked as a duplicate of 2823 ***