Bug 221755

Summary: updatedb doesn't skip bind mounts
Product: [Fedora] Fedora Reporter: Axel Thimm <axel.thimm>
Component: mlocateAssignee: Miloslav Trmač <mitr>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideKeywords: Reopened
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-03-06 02:12: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 Axel Thimm 2007-01-07 14:41:40 UTC
When bind mounts are present updatedb enters them and lists the files several
times. Currently only modifying PRUNEPATHS seems to help.

Is there a better way to skip bind mounts w/o having to explicitely maintain a
list of them? If not is it worth while adding such a check to mlocate? Thanks!

Comment 1 Miloslav Trmač 2007-02-27 21:26:01 UTC
Thanks for your report.

I have seen bind mounts used in both of these ways:
a) mount --bind /home /path/to/chroot/home
b) mount --bind /mnt/big_disk /home/big_user

For a) the right thing is to ignore the destination, for b) to ignore the
source.  I don't think mlocate can automatically determine what it should do.

Comment 2 Axel Thimm 2007-02-27 23:36:06 UTC
Always ignore the destination. The same argument could be brought forward for
symlinks, in fact usecase b) should seriously consider using symlinks or
directly mounting big_disk's device into /home/big_user.

Even for b) the admin will be grateful for not hammering his big_disk multiple
times. And with systems that do this multiple times (think of Fedora build
servers bind-mounting whole kernel-src trees into chroots or any other chroot
setup like http, ftp etc. bind-mounting the contents) you actually stall the
system into updatedb until noon (and that's on FC-SAN).

Since this is actually killing servers, I'm not considering this a feature
request anymore, but indeed a bug. At the very least it should be up to the
admin to decide on whether to follow bind-mounts or not. Currently the options
are no updatedb at all of nfs-mounting from localhost instead of bind-mounts,
which kills performance.

Comment 3 Miloslav Trmač 2007-03-06 02:12:46 UTC
Thanks, I didn't realize there are legitimate cases of bind mounting the same
subtree ten or more times.

mlocate-0.16 has PRUNE_BIND_MOUNTS; disabled by default upstream, but enabled in
the Fedora package.


Comment 4 Axel Thimm 2007-03-06 12:53:52 UTC
Thanks a ton, Miloslav, I'm going to test it on the FC6 setups by rebuilding the
src.rpm there.