This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 797383

Summary: du does not display the size of /run
Product: [Fedora] Fedora Reporter: Tomas Toth <ttomasz>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: kdudka, maxamillion, ovasik, p, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-27 03:50:41 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Attachments:
Description Flags
Output of: strace du -s /var /run > strace_du_var_run.log 2>&1 none

Description Tomas Toth 2012-02-25 07:48:12 EST
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 08:14:14 EST
/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 09:11:55 EST
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 09:14:39 EST
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 09:19:23 EST
There is no error message. The return code ($?) is zero.
Comment 5 Kamil Dudka 2012-02-27 03:50:41 EST
(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 ***