Re: [Tracker] [PATCH] Make tracker skip mountpoints



On 8/6/07, Marcus Fritzsch <fritschy googlemail com> wrote:
On 8/6/07, jamie <jamiemcc blueyonder co uk> wrote:
On Mon, 2007-08-06 at 13:36 +0200, Marcus Fritzsch wrote:
On 8/6/07, jamie <jamiemcc blueyonder co uk> wrote:
On Mon, 2007-08-06 at 04:03 +0200, Marcus Fritzsch wrote:
This patch prevents tracker from descending into mountpoints which is
a directory other than a watch- or crawl-root. I often have some fs
(sshfs, nfs) mounted under my $HOME and found tracker going down all
these trees. Also, there was a bug report on launchpad about this[1].

I am however not sure if this method works, also I haven't found much
references when searching for it by google or clusty. If there are
objections to this method of mount-point 'discovery' it would be
possible to read mtab and store it in struct Tracker for processing.

However as tracker is not that simple I am not aware of any side
effects this patch may have on tracker, I tested it - with mount
points in watched dirs and crawled ones, with fuse and nfs mounts.

Any comments?


yeah its a good idea

but take a look at tracker-utils.c:

tracker_file_is_no_watched
tracker_file_is_crawled

Thought of this too. The function signature needs a 'current' dir and
a 'testdir' to check wether testdir is a different device then current
- there is no problem with that? That would be faster - however I
could also implement it by checking against the crawl and watch
directory roots list. Which one do you prefer?

I would prefer the latter but can we store the device signature of the
watch and crawl dirs somewhere so we are not constantly stating them?

(Could use a GSList to store them and simply iterate over them)

Here is an overview on how skipping mount points work:

0a. Fields added: Tracker.root_directory_devices and Tracker.skip_mount_points

0b. Functions added: tracker_add_root_dir (),
tracker_add_root_directories () and tracker_file_is_in_root_dir ().
All in declared tracker-utils.h and implemented in tracker-utils.c.

1. Each service directory is added to the GSList
Tracker.root_directory_devices - there will be no doubles - that is
checked with a loop, if it gets too slow I could switch it e.g. to a
tree.

2. The new functions check for Tracker.skip_mount_points - so no one
has to do the check but those added functions.

3. get_files ignores files returned as not being on the same device as
the currently read directory (this, only if skip_mount_points is
enabled, see above).

4. A config option SkipMountPoints has been added to the Watches
section of tracker.cfg.

5. The default is to descend into mounted directories, as it was before.

I tested this patch quite a lot, including a --reindex run.

Cheers, Marcus

Hi Jamie,

here is the fix for the config option being in the semantically wrong
section. I moved it to the Indexing section. Both patches are against
svn r745.

Cheers, and sry for those spam mails, Marcus

Attachment: tracker_r745_skip_mount_points.patch
Description: Text Data

Attachment: tracker_r745_skip_mount_points_tracker-preferences.patch.gz
Description: GNU Zip compressed data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]