Regular 'find' searches of cron jobs, should not search BTRFS snapshots

Bug #1288106 reported by Nikola M
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
anacron (Ubuntu)
New
Undecided
Unassigned

Bug Description

'find' util that get called to index files on disk , goes crazy if there are new BTRFS snapshots of main System subvolume (@)
and starts searching inside of them making index for various scheduled tasks,
even if snapshot contents is identical to that indexed before.
(BTRFS unlike ZFS have it's snapshots exposed as at least read-only and even read-write by default at the root of snapshotted subvolume mountpoint - /@snapshotname par example for system subvolume)

How to reproduce: use BTRFS as root (/, system) filesystem.
make Several BTRFS snapshots of main system subvolume (@)
watch as find util constantly searches inside of snapshots, at the time in day designated to run daily and other cron jobs.

It could also go for other snapshots, not only system one, (@/home , whatever)
where a) aether program invoking find in cron job should be aware of BTRFS specifics
and not waste time in searching in consequent snapshots, but only look at differences in files between them,
b) or find util itself could be made more clever to recognize BTRFS snapshots
c) or some other tool for searching should be used, that recognize BTRFS and ZFS snapshots (they reside in hidden .zfs directory, if implemented, so I suppose they are spared from find redudant searches?, for now)

I go for a) for starters, because at least 2 main system subvolumes (@ and @home) could avoid such find-trashing of their snapshots. and go for c) and/or b) in the future,
where is a) is used, there could be a list of BTRFS subvolumes somewhere in /etc, that presents Paths where indexing should be avoided, or indexing gets done only on changed parts between snapshots.

Also, not fixing this bug could lead of people stop using BTRFS because of Ubuntu not recognizing it's specifics and with large snapshotting use (that is quite inexpensive on copy-on-write filesystems) could lead to trashing systems with redundant find work.

Alternative d) is that BTRFS itself in Ubuntu does not expose BTRFS subvolume snapshots in the filesystem mount point,
but at least to do that somewhere where 'find' can not find it or does not mount subvolume snapshots at all until needed.

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: anacron 2.3-19ubuntu2
ProcVersionSignature: Ubuntu 3.11.0-17.31-generic 3.11.10.3
Uname: Linux 3.11.0-17-generic x86_64
NonfreeKernelModules: zfs zunicode zavl zcommon znvpair nvidia
ApportVersion: 2.12.5-0ubuntu2.2
Architecture: amd64
Date: Wed Mar 5 08:35:51 2014
InstallationDate: Installed on 2012-10-26 (494 days ago)
InstallationMedia: Xubuntu 12.04.1 LTS "Precise Pangolin" - Release amd64 (20120822.1)
MarkForUpload: True
SourcePackage: anacron
UpgradeStatus: Upgraded to saucy on 2014-02-10 (22 days ago)

Revision history for this message
Nikola M (nikolam) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.