Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Cause:
When updatedb is spawned by cron it prunes all "API" filesystems, i.e. filesystems which have no backing device, thus are marked as nodev in /proc/filesystems. ZFS on Linux is also marked nodev despite the fact it is filesystem used to actually store the data.
Consequence:
ZFS volumes are not indexed.
Fix:
Exception for ZFS was added to cron script thus when updatedb is spawned it will also index ZFS filesystems.
Result:
It is possible to search with locate for files stored on ZFS filesystems.
Created attachment 816584[details]
Patch implementing the proposed solution
Description:
I've determined that mlocate's cronjob (/etc/cron.daily/mlocate.cron) doesn't index any ZFS filesystems.
The reason for this is that the cronjob builds a list of all "nodev" filesystem types listed in /proc/filesystems, which unfortunately includes ZFS.
I can understand mlocate's rationale for doing that (so as to avoid indexing obviously pseudo filesystems like /proc, /sys, etc), but in ZFS case, it's wrong. Also, I can understand ZFS' rationale for listing itself as "nodev": a ZFS filesystem is not directly connected to a device, it's connected to a ZFS pool (which in turn is connected to a device).
So, it seems we have an unintentional side-effect of the two rationales above.
To fix it, I patched the cronjob to source a config file (/etc/sysconfig/mlocate) which defines a single env var called NODEV_FS_TO_SCAN_REGEXP; this should be an awk regexp matching every filesystem which should be indexed by mlocate *even* if it's listed as "nodev" in /proc/filesystems; this way, we have a generic fix which can be used for other filesystem types, in case others in the future fall in the same category as ZFS.
Version-Release number of selected component (if applicable): 0.22.2-4.el6 on RHEL 6.4.
How reproducible: 100%
Steps to Reproduce:
1. Run "/etc/cron.daily/mlocate" with a mounted ZFS filesystem;
2. Wait for it to finish;
3. Try to locate any file in the ZFS filesystem using "locate filename"
Actual results:
Files in ZFS filesystem aren't shown by "locate".
Expected results:
Files in ZFS filesystem should be shown by "locate".
Additional info:
Problem originally reported in the zfs-discuss mailing list (see my post here: https://groups.google.com/a/zfsonlinux.org/forum/#!msg/zfs-discuss/nxlya9MNmYc/2u9jZTr2W4oJ); I've fixed the issue and determined that "upstream" in this case is Redhat EL6, so I'm reporting it here along with my patch.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHBA-2015-0676.html