Avoid inserting an invalid "Size" property from the Filesystem interface
Needs ReviewPublic

Authored by bruns on Apr 11 2018, 10:39 PM.

Details

Reviewers
None
Group Reviewers
Frameworks
Summary

UDisks2 added a "Size" property for the Filesystem interface, which may
be zero, denoting an unknown value:
http://storaged.org/doc/udisks2-api/2.7.6/gdbus-org.freedesktop.UDisks2.Filesystem.html
#gdbus-property-org-freedesktop-UDisks2-Filesystem.Size

For e.g. Ext4, the property matches the Size from Partition and Block,
while for FAT and BTRFS 0 is returned.

Test Plan

make
solid-hardware5 list details

Diff Detail

Repository
R245 Solid
Branch
invalid_fs_size
Lint
No Linters Available
Unit
No Unit Test Coverage
bruns created this revision.Apr 11 2018, 10:39 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 11 2018, 10:39 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
bruns requested review of this revision.Apr 11 2018, 10:39 PM
broulik added inline comments.
src/solid/devices/backends/udisks2/udisksdevicebackend.cpp
147

So when size is unknown it will always query it as you will never have a Size in the m_propertyCache?

bruns added inline comments.Apr 12 2018, 6:17 PM
src/solid/devices/backends/udisks2/udisksdevicebackend.cpp
147

It uses the one from the Partition or Block Interface, see last paragraph from the Summary.
It restores the behaviour from UD2 <= 2.7.5, which did not have this property.
For most cases, this is correct, but it might be wrong when using e.g. the BTRFS-internal Raid implementation.

bruns marked an inline comment as done.Apr 26 2018, 6:35 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald TranscriptAug 18 2018, 4:35 PM