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: More: Recent increase in size


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Reini Urban on 5/17/2005 5:14 PM:
> mkdir -p /tmp/test/test1 /tmp/test/test2
> cd /tmp/test
> # junction or mount is the same here
> junction `cygpath -w /tmp/test/test1` test3
> cp ../* test1/
> ls -i
>   22236523160786906 test1   9288674232096745 test2  22236523160786906 test3
> # test2 is empty, test3 hardlinked to test1
> $ du
> 2636    ./test1
> 0       ./test2
> 2636    ./test3
> 5272    .
> $ du -l
> 2636    ./test1
> 0       ./test2
> 2636    ./test3
> 5272    .
> 
> => coreutils bug with du opt_count_all=0 ?
> 

It took me a while to reproduce this.

$ cd /tmp/
$ mkdir example
$ cd example
$ echo hello > file1
$ ln file1 file2
$ du
1       .
$ du -l              # So far, so good - linked files counted just once
2       .
$ mkdir dir1
$ mkdir dir2
$ echo goodbye > dir1/file
$ ln dir{1,2}/file
$ du
1       ./dir1
0       ./dir2
2       .
$ du -l             # Still good, over subdirectories
1       ./dir1
1       ./dir2
4       .
$ mount `cygpath -w /tmp/example/dir1` /tmp/example/dir3
$ ls -iRF
.:
14952513712823677584 dir1/      2251799813894795 file1
   28147497671275154 dir2/      2251799813894795 file2
14952513712823677584 dir3/

./dir1:
17343925114957410972 file

./dir2:
17343925114957410972 file

./dir3:
17343925114957410972 file
$ du         # Good even with hard-linked (well, mounted) directories...
1       ./dir1
0       ./dir2
0       ./dir3
2       .
$ du -l      # ...where file was also linked outside linked directories
1       ./dir1
1       ./dir2
1       ./dir3
5       .
$ echo testing > dir3/file3
$ ls -iRF
.:
14952513712823677584 dir1/      2251799813894795 file1
   28147497671275154 dir2/      2251799813894795 file2
14952513712823677584 dir3/

./dir1:
17343925114957410972 file      1970324837184162 file3

./dir2:
17343925114957410972 file

./dir3:
17343925114957410972 file      1970324837184162 file3
$ du              # Whoops - file3 is showing up twice
2       ./dir1
0       ./dir2
1       ./dir3
4       .
$ du -l
2       ./dir1
1       ./dir2
2       ./dir3
7       .

I'll have to investigate further, but it is probably an upstream bug.

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCiztc84KuGfSFAYARAmNuAJ9o5n7PLVW6oGIMd9JQ05zb6XmGvgCgyMRg
yJLYHD4ExhCI+Y0M39neEJA=
=4JE4
-----END PGP SIGNATURE-----

--
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]