Diffusion Baloo 43ab022f35e8

[Scheduler] Fix wrong usage of obsolete QFileInfo::created() timestamp

Authored by bruns on Oct 16 2018, 5:34 PM.

Description

[Scheduler] Fix wrong usage of obsolete QFileInfo::created() timestamp

Summary:
Baloo uses the metadata change time (stat.st_ctime, man 7 inode) to check
for XAttr updates. This field corresponds to
QFileInfo::metadataChangeTime(), while created() returns the first
available of [birthtime, ctime, mtime].

On filesystems supporting birthtime (XFS, BTRFS) some files were
continously reindexed as the BasicIndexingJob stored the ctime, while the
UnindexedFileIterator compared the stored value with the btime. On the
other hand, XAttr changes where not detected when ctime and btime
initially matched, as the btime is fixed.

While at it, document the semantics of the two timestamps.

CCBUG: 349615
CCBUG: 397549

Test Plan:

  1. watch baloo_file with strace -efile during startup -> files with btime != ctime are indexed just once
  2. add a Tag to a file -> file is immediately updated in index, not just after baloo_file restart (e.g. session restart)

Reviewers: Baloo, Frameworks, poboiko, ngraham, lbeltrame

Reviewed By: lbeltrame

Subscribers: lbeltrame, kde-frameworks-devel

Tags: Frameworks, Baloo

Differential Revision: https://phabricator.kde.org/D16255

Details

Committed
brunsOct 25 2018, 4:11 PM
Reviewer
lbeltrame
Differential Revision
D16255: [Scheduler] Fix wrong usage of obsolete QFileInfo::created() timestamp
Parents
R293:1509ca51c5ed: [Extractor] Make extractor crash resilient
Branches
Unknown
Tags
Unknown