Bug 797383 - du does not display the size of /run
Summary: du does not display the size of /run
Keywords:
Status: CLOSED DUPLICATE of bug 747075
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 16
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-25 12:48 UTC by Tomas Toth
Modified: 2012-02-27 08:50 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-02-27 08:50:41 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Output of: strace du -s /var /run > strace_du_var_run.log 2>&1 (4.87 MB, text/plain)
2012-02-25 14:14 UTC, Tomas Toth
no flags Details

Description Tomas Toth 2012-02-25 12:48:12 UTC
Description of problem:
Command du does not display the size of /run under certain conditions.
It seem to be linked to the given command line parameter order, if /var precedes /run.

Version-Release number of selected component (if applicable):
coreutils.x86_64  8.12-6.fc16

How reproducible:
Always

Steps to Reproduce:
1. Run the test following test script. Cases with missing /run printouts are marked with "echo Fail".

#!/bin/bash -v

du -s /usr /run /var
echo OK

du -s /usr /var /run
echo Fail

du -s /run /var /usr
echo OK

du -s /run /usr /var
echo OK

du -s /var /usr /run
echo Fail

du -s /var /run /usr
echo Fail


du -s /usr /run
echo OK

du -s /run /usr
echo OK


du -s /var /run
echo Fail

du -s /run /var
echo OK


Actual results:
Output of the above test script.

#!/bin/bash -v

du -s /usr /run /var
4471196 /usr
49860   /run
1381428 /var
echo OK
OK

du -s /usr /var /run
4471196 /usr
1431288 /var
echo Fail
Fail

du -s /run /var /usr
49860   /run
1381428 /var
4471196 /usr
echo OK
OK

du -s /run /usr /var
49860   /run
4471196 /usr
1381428 /var
echo OK
OK

du -s /var /usr /run
1431288 /var
4471196 /usr
echo Fail
Fail

du -s /var /run /usr
1431288 /var
4471196 /usr
echo Fail
Fail


du -s /usr /run
4471196 /usr
49860   /run
echo OK
OK

du -s /run /usr
49860   /run
4471196 /usr
echo OK
OK


du -s /var /run
1431288 /var
echo Fail
Fail

du -s /run /var
49860   /run
1381428 /var
echo OK
OK


Expected results:
The size of /run is (always) printed as requested.


Additional info:
Please let me know if you need something else.


Thanks.

Comment 1 Ondrej Vasik 2012-02-25 13:14:14 UTC
/run is symlink to /var/run in F16+ - systemd changes... therefore it probably doesn't like when /var is called afterwards - so maybe protection for counting duplicates.

What does the du print as an error message? What is the error code? Could you please get strace of the "du -s /var /run" ? (This one should be sufficient, others are just modifications of this)
I don't have F16 installation available at the moment, so I can't check that myself.

Comment 2 Tomas Toth 2012-02-25 14:11:55 UTC
Ondrej,

The machine is an F16 upgraded from F15 using preupgrade.
The /run is a directory not a symlink:
$ ll -d /var /run /var/run
drwxr-xr-x. 34 root root 1180 Feb 25 13:06 /run
drwxr-xr-x. 19 root root 4096 Dec 11 13:37 /var
drwxr-xr-x. 34 root root 1180 Feb 25 13:06 /var/run

$ mount | egrep 'var|run'
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,seclabel,mode=755)
tmpfs on /var/run type tmpfs (rw,nosuid,nodev,relatime,seclabel,mode=755)
tmpfs on /var/lock type tmpfs (rw,nosuid,nodev,relatime,seclabel,mode=755)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)

The strace will follow soon.

Comment 3 Tomas Toth 2012-02-25 14:14:39 UTC
Created attachment 565756 [details]
Output of: strace du -s /var /run > strace_du_var_run.log 2>&1

Comment 4 Tomas Toth 2012-02-25 14:19:23 UTC
There is no error message. The return code ($?) is zero.

Comment 5 Kamil Dudka 2012-02-27 08:50:41 UTC
(In reply to comment #2)
> $ mount | egrep 'var|run'
> tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,seclabel,mode=755)
> tmpfs on /var/run type tmpfs (rw,nosuid,nodev,relatime,seclabel,mode=755)

It looks like there is a bind mount between /run and /var/run on your machine.  du does not list a directory that was already included in a previous directory.  There is a ticket at Austin Group for this issue:

http://austingroupbugs.net/view.php?id=527

You can use the --count-links (-l) option as a workaround.

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


Note You need to log in before you can comment on or make changes to this bug.