Skip to content

Use the FSID as the device identifier where possible

Nate Graham requested to merge work/cherry-pick-c735faf5 into kf5

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.

BUG: 402154 CCBUG: 471289

(cherry picked from commit c735faf5)

Merge request reports