Wind River Support Network


LIN6-6666 : smart/rpm lstat'ing all mount pounts during do_rootfs task

Created: Feb 12, 2014    Updated: Dec 3, 2018
Resolved Date: Feb 14, 2014
Previous ID: LIN5-17977
Found In Version: 6.0
Fix Version:
Severity: Standard
Applicable for: Wind River Linux 6
Component/s: Build & Config


Customer noticed that do_rootfs takes a very long time in their environment. Using strace they discovered that lstat() was being called on every filesystem mounted on the build hosts.

On a regular desktop this would probably have only a low impact, but on a central build server with many NFS mounts (eg user home directories) and other resources such as ClearCase vobs this lstat() of every mount can take a significant amount of time.

We believe the reason for the lstat() is that rpm is verifying that enough free disk space is available to do the install. However, since the install is into the target rootfs it should not matter how much free space there is in the hosts mounts. Perhaps it makes sense to check the disk on which the build takes place, but nowhere else.


Applying the following patch seems to disable the lstat() and greatly improves the build time for the customer.

--- a/smart/backends/rpm/	2013-12-11 08:23:43.419436921 +0000
+++ b/smart/backends/rpm/	2013-12-11 08:25:15.179224127 +0000
@@ -232,6 +232,8 @@
         if sysconf.get("rpm-order"):
         probfilter = rpm.RPMPROB_FILTER_OLDPACKAGE
+        probfilter |= rpm.RPMPROB_FILTER_DISKNODES
+        probfilter |= rpm.RPMPROB_FILTER_DISKSPACE
         if force or reinstall:
             probfilter |= rpm.RPMPROB_FILTER_REPLACEPKG
             probfilter |= rpm.RPMPROB_FILTER_REPLACEOLDFILES

Steps to Reproduce

Doing a regular build of any platform project (WRL5+) will finally call the do_rootfs task.

Edit the smart script to start smart.real under strace and lof the results to a file.

By grep through the log you will find lstat() is called on every mounted filesystem.

Other Downloads

Live chat