Bug #8961
closeddu [directory] vs du -b [directory] size doubles
0%
Description
Under cephfs using the kernel client, du -b shows an incorrect size.
I've also found that du --apparent-size shows this incorrectly as well.
For example, I have the following directory:
admin@desktop1:$ ls -l 370mo total 373090 -rwxr-xr-x 1 www-data www-data 38204331 Feb 21 06:36 7656_gsoc-tomato.win7.x64-48999 - Copy (2).7z -rwxr-xr-x 1 www-data www-data 38204331 Feb 21 06:36 7656_gsoc-tomato.win7.x64-48999 - Copy (3).7z -rwxr-xr-x 1 www-data www-data 38204331 Feb 21 06:36 7656_gsoc-tomato.win7.x64-48999 - Copy (4).7z -rwxr-xr-x 1 www-data www-data 38204331 Feb 21 06:36 7656_gsoc-tomato.win7.x64-48999 - Copy (5).7z -rwxr-xr-x 1 www-data www-data 38204331 Feb 21 06:36 7656_gsoc-tomato.win7.x64-48999 - Copy (6).7z -rwxr-xr-x 1 www-data www-data 38204331 Feb 21 06:37 7656_gsoc-tomato.win7.x64-48999 - Copy (7).7z -rwxr-xr-x 1 www-data www-data 38204331 Feb 21 07:19 7656_gsoc-tomato.win7.x64-48999 - Copy (8).7z -rwxr-xr-x 1 www-data www-data 38204331 Feb 21 06:36 7656_gsoc-tomato.win7.x64-48999 - Copy - Copy (2).7z -rwxr-xr-x 1 www-data www-data 38204331 Feb 21 07:18 7656_gsoc-tomato.win7.x64-48999 - Copy - Copy (3).7z -rwxr-xr-x 1 www-data www-data 38204331 Feb 21 07:18 7656_gsoc-tomato.win7.x64-48999 - Copy - Copy (4).7z admin@desktop1:$ du -370mo 373090 370mo/ admin@desktop1:$ du -h 370mo/ 365M 370mo/ admin@desktop1:$ du -b 370mo/ 764086620 370mo/ admin@desktop1:$ du --apparent-size 370mo/ 746179 370mo/ admin@desktop1:/370mo$ du --apparent-size *.7z 38204331 7656_gsoc-tomato.win7.x64-48999 - Copy (2).7z 38204331 7656_gsoc-tomato.win7.x64-48999 - Copy (3).7z 38204331 7656_gsoc-tomato.win7.x64-48999 - Copy (4).7z 38204331 7656_gsoc-tomato.win7.x64-48999 - Copy (5).7z 38204331 7656_gsoc-tomato.win7.x64-48999 - Copy (6).7z 38204331 7656_gsoc-tomato.win7.x64-48999 - Copy (7).7z 38204331 7656_gsoc-tomato.win7.x64-48999 - Copy (8).7z 38204331 7656_gsoc-tomato.win7.x64-48999 - Copy - Copy (2).7z 38204331 7656_gsoc-tomato.win7.x64-48999 - Copy - Copy (3).7z 38204331 7656_gsoc-tomato.win7.x64-48999 - Copy - Copy (4).7z
Why does the size seem to double when using du on a directory vs the files themselves?
This bug exists in emperor release, and I just upgraded to firefly stable. The problem still exists.
uname -a
Linux desktop1 3.12.0-031200-generic #201311031935 SMP Mon Nov 4 00:36:54 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 12.04.4 LTS
Release: 12.04
Codename: precise
Updated by Zheng Yan almost 10 years ago
- Status changed from New to Won't Fix
cephfs tracks recursive directory stats. A directory's size is space used by files underneath the directory. If you don't like this behaviour, you can disable it by 'norbytes' mount option.