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

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

Details

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)

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Oct 16 2018, 5:39 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptOct 16 2018, 5:39 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Oct 16 2018, 5:39 PM
bruns edited the summary of this revision. (Show Details)Oct 16 2018, 6:06 PM
bruns edited the summary of this revision. (Show Details)Oct 16 2018, 6:24 PM

Very nice catch! I'm afraid my brain is not big enough to review this one though.

+1, looks fine to me as far as I understand.

bruns added a comment.Oct 25 2018, 2:53 PM

Good to go?

lbeltrame accepted this revision.Oct 25 2018, 3:30 PM
This revision is now accepted and ready to land.Oct 25 2018, 3:30 PM
This revision was automatically updated to reflect the committed changes.