Bug 221755 - updatedb doesn't skip bind mounts
Summary: updatedb doesn't skip bind mounts
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: mlocate
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Miloslav Trmač
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-01-07 14:41 UTC by Axel Thimm
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2007-03-06 02:12:46 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


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