Bug 373613 - Notify message not accurate as "This device can now be safely removed."
Summary: Notify message not accurate as "This device can now be safely removed."
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Disks & Devices widget (show other bugs)
Version: 5.8.4
Platform: openSUSE Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-13 14:16 UTC by CnZhx
Modified: 2020-01-13 03:58 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description CnZhx 2016-12-13 14:16:55 UTC
When removing a USB device from the system by clicking the eject icon on the Device Notifier applet, the message says "This device can now be safely removed." I think this message is not accurate, because the device cannot be removed at this moment but can only be safely removed after the icon for this device disappears.

I learned this after my USB stick being broken several times.

So the expected message should be something like "This device is being safely removed" or "Please wait for safely removing this device".
Comment 1 Kai Uwe Broulik 2017-01-01 21:40:25 UTC
The message is supposed to only show up once the unmount process has finished, ie. you click "unmount", you get a spinny thing, and only thereafter you should get said message?
Comment 2 CnZhx 2017-01-02 09:30:26 UTC
(In reply to Kai Uwe Broulik from comment #1)
> The message is supposed to only show up once the unmount process has
> finished, ie. you click "unmount", you get a spinny thing, and only
> thereafter you should get said message?

Yes, I guess that what you described should be the correct sequence. However, I plugged out USB stick during the display of this message several times after the spinny thing (it's slow blinking for me), and the USB stick was caused sort of file structure damage. The damage could be easily fixed by "Error Check" in Windows though.

After these, I always wait for the device to disappear from Device Notification widget and then plug out the USB stick. And based on this, I think the notifying message should be altered to reflect this fact.
Comment 3 David Edmundson 2017-01-02 20:50:13 UTC
That's not very concrete evidence to suggest it hasn't actually been unmounted properly.

The Solid code definitely waits for udisks to reply that the unmount call has finished before emitting it's finished and the device notifier plasmoid definitely waits for solid to reply before it displays that notification. 

I've done a brief code review and I can't see anything wrong on KDE's side.

We should check that you're using the udisks backend though: Can you include the output of "solid-hardware5 list"
Comment 4 David Edmundson 2017-01-02 20:52:42 UTC
Can you also include the output of

 solid-hardware5 listen

whilst trying to recreate this.
Comment 5 CnZhx 2017-01-02 22:15:22 UTC
Output of `solid-hardware5 list`:
`
udi = '/org/freedesktop/UDisks2/block_devices/sdb'
udi = '/org/freedesktop/UDisks2/drives/Kingston_DataTraveler_3_2e0'
`
I trimmed the output to only include those related to the USB stick. Hopefully it is enough for the investigation.

And output of `solid-hardware5 listen` while detaching the udisk when it is still being removed. There is no other operation on this USB stick this time.
`
~> solid-hardware5 listen
Listening to add/remove events: 
"/org/freedesktop/UDisks2/block_devices/sdb1" lost interfaces: ("org.freedesktop.UDisks2.Filesystem")
"/org/freedesktop/UDisks2/block_devices/sdb" lost interfaces: ("org.freedesktop.UDisks2.PartitionTable")
"/org/freedesktop/UDisks2/block_devices/sdb1" lost interfaces: ("org.freedesktop.UDisks2.Partition", "org.freedesktop.UDisks2.Block")
Device Removed:
udi = '/org/freedesktop/UDisks2/block_devices/sdb1'
"/org/freedesktop/UDisks2/block_devices/sdb" lost interfaces: ("org.freedesktop.UDisks2.Block")
Device Removed:
udi = '/org/freedesktop/UDisks2/block_devices/sdb'
"/org/freedesktop/UDisks2/drives/Kingston_DataTraveler_3_2e0" lost interfaces: ("org.freedesktop.UDisks2.Drive")
Device Removed:
udi = '/org/freedesktop/UDisks2/drives/Kingston_DataTraveler_3_2e0'
`

Another output of `solid-hardware5 listen` while detaching the udisk after making a file-syncing using FreeFileSync. But the udisk is removed after the messages disappeared. I could not catch the timing because there was a long time display of "Removing", and then, "Removing" on top of "This device can now be safely removed." In other words, there is no time of only showing the message of "This device can now be safely removed", or the time is too short for me to see.
`
~> solid-hardware5 listen
Listening to add/remove events: 
"/org/freedesktop/UDisks2/block_devices/sdb1" lost interfaces: ("org.freedesktop.UDisks2.Filesystem")
"/org/freedesktop/UDisks2/block_devices/sdb" lost interfaces: ("org.freedesktop.UDisks2.PartitionTable")
"/org/freedesktop/UDisks2/block_devices/sdb1" lost interfaces: ("org.freedesktop.UDisks2.Partition", "org.freedesktop.UDisks2.Block")
Device Removed:
udi = '/org/freedesktop/UDisks2/block_devices/sdb1'
"/org/freedesktop/UDisks2/block_devices/sdb" lost interfaces: ("org.freedesktop.UDisks2.Block")
Device Removed:
udi = '/org/freedesktop/UDisks2/block_devices/sdb'
"/org/freedesktop/UDisks2/drives/Kingston_DataTraveler_3_2e0" lost interfaces: ("org.freedesktop.UDisks2.Drive")
Device Removed:
udi = '/org/freedesktop/UDisks2/drives/Kingston_DataTraveler_3_2e0'
`

Since there were several updates to FreeFileSync and many updates to openSUSE Tumbleweed, maybe the problem have vanished. I have not tried this since I filed this bug report. I am really sorry for wasting your time checking this if this is not a bug in this component.
Comment 6 Christoph Feck 2017-01-04 21:20:09 UTC
I doubt the 'unmount' process waits for kernel I/O to finish before returning.
Comment 7 Nate Graham 2020-01-13 03:42:30 UTC
It might now, actually. I've had a few times where clicking unmount has resulted in a delay before the message appeared.

Is this still an issue for people?
Comment 8 CnZhx 2020-01-13 03:55:31 UTC
I have not experienced any glitch of such issue for a long time. I consider this had been fixed for me. Thanks a lot for the work!
Comment 9 Nate Graham 2020-01-13 03:58:53 UTC
You're welcome!