Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • B Baloo
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • FrameworksFrameworks
  • Baloo
  • Merge requests
  • !131

Draft: Use the FSID as the device identifier where possible

  • Review changes

  • Download
  • Patches
  • Plain diff
Open Tomáš Trnka requested to merge work/ttrnka/fsid_as_devid into master May 17, 2023
  • Overview 1
  • Commits 1
  • Pipelines 2
  • Changes 1

The device number returned by stat() in st_dev is not persistent in many cases. Btrfs subvolumes or partitions on NVMe devices are assigned device numbers dynamically, so the resulting device ID is typically different after every reboot, forcing Baloo to repeatedly reindex all files.

Fortunately, filesystems like Btrfs or ext4 return a persistent unique filesystem ID as f_fsid from statvfs(), so we can use that when available. Other filesystems like XFS derive the FSID from the device number of the underlying block device, so switching to the FSID does not change anything.

Draft pending discussion of the following points:

  • This change will cause all IDs to change one last time, so everything will be reindexed once again. It would be best if we could somehow purge the old entries, perhaps trigger a "balooctl purge" once when the framework is updated?
  • Perhaps the include needs to be guarded by HAVE_SYS_STATVFS_H and checked by CMake, but it looks like other frameworks don't do that either, so this might be fine as is.

BUG: 402154

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: work/ttrnka/fsid_as_devid