Bug 746096

Summary: mock caches bind mounted directories
Product: [Fedora] Fedora Reporter: Piotr Romanus <tytus64>
Component: mockAssignee: Clark Williams <williams>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 12CC: mebrown, williams
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-14 02:09:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Piotr Romanus 2011-10-13 21:07:27 UTC
Description of problem:
mock caches directories added to a jail using bind_mount_opts config options. This makes the cache extremely large and takes very long time if the mounted directory is large.


Version-Release number of selected component (if applicable): Discovered in mock-1.1.12-1.fc15.noarch. I believe that this is still the problem in 1.1.15.


How reproducible:
Every time


Steps to Reproduce:
1.Added the following to my /etc/mock/site-defaults.cfg
config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/users', '/users' ))

/users contains several home directories so it is very large.

2.Executed mock -r rhel-5-i386 --buildsrpm --spec mbe.spec --sources SOURCES --no-cleanup-after --resultdir=results --unpriv  --uniqueext=mbe

  
Actual results:
It took a very long time for the command to complete. The cache file contained /users


Expected results:
The cache file should not contain /users. bind mounted directories should not be cached since they presumably can be mounted again.


Additional info:
Here is a little patch that I added in order to avoid this problem:

diff --git a/py/mockbuild/plugins/root_cache.py b/py/mockbuild/plugins/root_cache.py
index ac53a2f..898f96f 100644
--- a/py/mockbuild/plugins/root_cache.py
+++ b/py/mockbuild/plugins/root_cache.py
@@ -127,7 +127,7 @@ class RootCache(object):
                 self.state("creating cache")
                 try:
                     mockbuild.util.do(
-                        ["tar"] + self.compressArgs + ["-cf", self.rootCacheFile,
+                        ["tar"] + ["--one-file-system"] + self.compressArgs + ["-cf", self.rootCacheFile,
                                                        "-C", self.rootObj.makeChrootPath()] +
                         self.exclude_tar_cmds + ["."],
                         shell=False

Comment 1 Clark Williams 2011-10-14 00:16:58 UTC
Piotr,

I was working on a different bug for the same problem:

https://bugzilla.redhat.com/show_bug.cgi?id=744727

I have to admit that your patch is simpler than mine :)

I may combine your addition to the tar command with elements of what I've already done for the config files.

Comment 2 Piotr Romanus 2011-10-14 02:09:46 UTC
Sorry for missing the fact that there is another bug describing the same problem. I will close this one as a duplicate then.

Thanks.

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