Bug 325245 - Udisks2 backend doesn't detect if device is set as removable
Summary: Udisks2 backend doesn't detect if device is set as removable
Status: RESOLVED FIXED
Alias: None
Product: solid
Classification: Unmaintained
Component: libsolid-udisks2 (show other bugs)
Version: 4.11.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Lukáš Tinkl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-24 11:42 UTC by Tejas Guruswamy
Modified: 2013-11-27 19:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.4
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tejas Guruswamy 2013-09-24 11:42:37 UTC
In the old udisks backend you could set a hard disk device (e.g. eSATA) as removable using udev to set "UDISKS_SYSTEM_INTERNAL". This was reflected in the device property "DeviceIsSystemInternal" which influenced whether a disk showed in the device notifier etc.

In Udisks2 this property has been replaced by UDISKS_SYSTEM and the device property "HintSystem" [1] but it looks like the udisks2 backend doesn't detect this.

[1] http://udisks.freedesktop.org/docs/latest/udisks.8.html

Reproducible: Always

Steps to Reproduce:
1. Connect drive marked by udev as HintSystem=0
2. Mounting no longer requires system-internal permissions

Actual Results:  
Device notifier fails to show drive as removable

Expected Results:  
Device notifier shows drive as removable
Comment 1 H.H. 2013-11-25 21:04:14 UTC
I have the same problem with my esata drive, it seems, at least here is missing something:

http://quickgit.kde.org/?p=kdelibs.git&a=blob&h=e38215403f4d923862c184abd9e9684691c25762&hb=5720d02a52b7db4322b6aa823292d345967b6125&f=solid%2Fsolid%2Fbackends%2Fudisks2%2Fudisksstoragedrive.cpp

in the corresponding udisks1 file the "DeviceIsSystemInternal" property is tested
Comment 2 H.H. 2013-11-26 21:28:18 UTC
I have fix for this:

in kdelibs in file "solid/solid/backends/udisks2/udisksstoragedrive.cpp"

change line 51 to

return _bus == Solid::StorageDrive::Usb || _bus == Solid::StorageDrive::Ieee1394 || (m_udevDevice.deviceProperty("UDISKS_SYSTEM").isValid() && !m_udevDevice.deviceProperty("UDISKS_SYSTEM").toBool());

Please apply my fix for the next kde-4.11 maintenance release.
Comment 3 Lukáš Tinkl 2013-11-26 23:38:35 UTC
Great, thanks for the patch, I will test it and commit
Comment 4 Lukáš Tinkl 2013-11-27 00:13:06 UTC
Have you tested this fix on your machine?
Comment 5 H.H. 2013-11-27 19:10:22 UTC
yes, I tested, and it works
Comment 6 Lukáš Tinkl 2013-11-27 19:38:49 UTC
Git commit 6241ec6f40881ec3a8f3ef4541d6d6953024a174 by Lukáš Tinkl.
Committed on 27/11/2013 at 19:37.
Pushed by lukas into branch 'KDE/4.11'.

detect removable devices more reliably with udisks2 backend

M  +2    -1    solid/solid/backends/udisks2/udisksstoragedrive.cpp

http://commits.kde.org/kdelibs/6241ec6f40881ec3a8f3ef4541d6d6953024a174