Bug 169060 - new device notifier eject behaviour for usb pendrives/iPods
Summary: new device notifier eject behaviour for usb pendrives/iPods
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: widget-devicenotifier (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-13 20:19 UTC by shishir verma
Modified: 2009-11-24 22:11 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description shishir verma 2008-08-13 20:19:07 UTC
Version:            (using KDE 4.1.0)
Installed from:    SuSE RPMs
Compiler:          gcc version 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036] (SUSE Linux)  
OS:                Linux

When I plugin my ipod, or a usb pendrive, I am able to see the new device notifier telling me about a new device having been plugged in.
So far so good, I am able to click on the name and able to see dolphin launched. Now, when I want to eject the device, I click the eject icon/button in the new device notifier. The usb pendrive is unmounted, as a tick mark is seen for a moment, in place of the notifier icon in system tray. This tick mark disappears, I assume signifying that the device can be removed safely. But, I am able to see the device still listed as plugged in and I am able to mount it back when I click on it.  This is more visible on the iPod, as even after clicking on the eject button, I am able to see "Do not disconnect" on the ipod screen. Now, I know that if mount command does not show this device, I can safely remove it, what with sync having already been done, but it might cause problems for the uninitiated.
Comment 1 Riccardo Iaconelli 2008-11-18 18:47:15 UTC
not sure if this is really kde-specific bug. it would mean ejecting the device instead of simply unmounting it.
Comment 2 shishir verma 2008-11-18 21:32:35 UTC
I dont know if it is kde-specific or not, but I am not able to see this happen on Gnome, or kde3.5.9 for that matter. So, there is definitely some change in behaviour, intentional or otherwise.
Comment 3 Salvatore Brigaglia 2009-01-15 00:17:42 UTC
Yes. It should call the "eject /dev/[device]" command when umounting such devices. It is also valid for Nokia N series phones (And we all now like Nokia phones!). They need to be ejected to show the message: "you can now disconnect the cable". 
I don't know if it should be provided by hal or something else but, in the same OS (openSUSE 11.1), KDE4 does not "eject" while KDE3 does.
Comment 4 Bruno Menegola 2009-08-21 21:42:06 UTC
I don't know how the system works at all, but it seems to me that copying a file to an usb device is an asynchronous task. Because, say we would like to transfer a 100MB file to it, dolphin or something else will think for two seconds and display "transference complete". But, in background, the system is still transferring the file. If you try umount the device, it will wait until the transfer is really complete.

With Kde4 is pretty unclear when the umount task is really done. It would be nice if this could be more explicit. Something like a popup notification with messages "please wait while umounting this device" and "umount complete. you can now unplug the device" would be a wonderful start.

I hope this helped. Thanks a lot.
Comment 5 Ernst Bachmann 2009-09-24 15:22:01 UTC
Similar issue as in http://bugs.gentoo.org/show_bug.cgi?id=270418:

the device is mounted by HAL, and hal sets the "storage.requires_eject" property to "true".
(side note: solidui doesn't offer a eject button on those devices, so you are forced to mount before you can eject...)

Now, when unmounting, solid/hal should "eject" the device, afterwards the iPod/Nokia should show thats its now OK to unplug.

However, solid tries to exec "/usr/bin/eject" on the device node, instead of telling DBUS to eject the device.
but if the user running solid doesn't have permissions on the device node, /usr/bin/eject fails (its "permission denied" error message lands in ~/.xsession-errors)

looking at kdelibs-4.3.1/solid/solid/backends/hal/halcdrom.cpp, the code to do the correct DBUS-"Eject" call seems to be in place, but is not executed.

So my guess is that the problem somehow lies in the fstab-handling of solid...

(and no, making /usr/bin/eject SUID root is not a solution)
Comment 6 Giulio Camuffo 2009-11-21 12:21:22 UTC
it seems to me that the problem lies in halstorageaccess.cpp, in slotDBusReply. there it checks the key storage.requires_eject, and if it is true it tries to eject the device calling eject instead of sending a dbus request to hal.
Comment 7 Giulio Camuffo 2009-11-24 22:11:29 UTC
Kevin committed a patch to solid (r1053814) and it should be fixed now. If you encounter this issue again reopen it.