https://bugs.kde.org/show_bug.cgi?id=404057

--- Comment #40 from Kai Krakow <k...@kaishome.de> ---
Further research confirms: btrfs has unstable device ids because it exposes
subvolumes as virtual block devices without their own device node in /dev.
Thus, device id numbers are allocated dynamically at runtime from the kernel,
the same happens for NFS and FUSE file systems. The latter usually even have
unstable inode numbers.

So currently, baloo is actually only safe to use on ext2/3/4 and xfs as the
most prominent examples. On many other filesystems it will reindex files, and
will even be unable to return proper results because reverse mapping of DocIds
to filesystem paths is unreliable.

This problem is deeply baked into the design of Baloo.

My idea of merging device id and ino into one 64-bit integer wouldn't needing
much modification to the existing code/storage format in theory. But apparently
this would make using the reverse mapping impossible because the functions
couldn't extract the device id from the docid to convert it back to a mount
path.

Additionally, btrfs shares the UUID between all subvolumes so using it would
make duplicate inode numbers which would confuse baloo. Btrfs has UUID_SUB
instead.

After all, it seems we'd need a specialized GUID generator per filesystem type.
Since GUID formats may differ widely, I'd suggest to create a registry table
inside the database, much similar to my counted ID idea outlined above. Each
new GUID would be simply registered in the table with a monotonically
increasing number which can be used as the device ID for DocId. Still, we'd
need to expand the DocId but temporarily it would do.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to