! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[PATCH] Shortcut pane: Problem with eject button
Status:
RESOLVED: FIXED

Comments

Description Harald Judt 2012-10-22 19:46:49 CEST
I've found the following strange problem ejecting a volume using the eject button. This problem has already been present in thunar-1.4.0.

It's reproducible very easily:
1) start thunar, plug in USB drive
2) eject the drive via the eject button (single left click)

Actual results:
The drive disappears, but behold the following error message:
Error mounting /dev/sdd1 at /run/media/user/usbdisk: Command-line `mount -t "ext4" -o "uhelper=udisks2,nodev,nosuid" "/dev/sdd1" "/run/media/user/usbdisk"' exited with non-zero exit status 32: mount: no medium found on /dev/sdd1

It seems that immediately after (successfully) ejecting the drive, thunar tries to mount the drive again. However, that drive is no longer available.

Note though that the following works without an error message:
1) start thunar, plug in USB drive
2) mount volume
3) eject the drive via the eject button (single left click)

Now let's look at the issue when a non-removable drive is being ejected:
1) mount volume (USB pen drive)
2) unmount volume via bookmark context menu (this works as expected)
3) eject the drive via the eject button (single left click)

This works without an error message, however the drive is immediately mounted again after step 3). So the results are similar, but in the first case the drive disappears and causes the error message to be displayed.

I've looked a bit into thunar-device.c, and it seems that there is everything ok in there (except probably bug #9402, but that doesn't fix it). I assume there must be something strange going on in the shortcut pane itself, but I gave up trying to trace this further because of lack of time (and it starts getting complicated, so I'd need much more time to get acquainted with the code).

Maybe some event does get propagated when it should not (click on event button also causes mounting).

I have not tested whether the same thing happens in other views (e.g. tree view).
Comment 1 Nick Schermer editbugs 2012-10-23 12:43:54 CEST
I think I need to implement device stopping here. See bug #7987.
Comment 2 Harald Judt 2012-10-23 13:09:46 CEST
Yes, that would indeed be a nice feature. Especially as then perhaps one could power down external SATA and USB hard drives before removing them, which might be more safe and better for the hardware.
Comment 3 Harald Judt 2012-10-23 21:55:42 CEST
I've seen commit b63fd6bcc7 "Improvements in device handling" and pulled the changes. However, the issue is still reproducible, same error.

And now I've tested mounting in tree view, and there a different error occurs:

1) Plug in USB stick, mount by expanding
2) Unmount via context menu
3) Try to mount again by expanding

Actual results:
Error message about mounting failure: "DBus error org.gtk.Private.RemoteVolumeMonitor.Failed: An operation is already pending."

Expected results:
Device to be mounted again.

BTW: In tree view, mount->unmount->eject works fine.

Stopping the drive doesn't work with SATA drives, I guess they count as internal and GIO doesn't report them as "stoppable". I haven't done any tests with external hard drives yet.

Note that I have done the previous mount tests with USB sticks, not USB hard drives.
Comment 4 Harald Judt 2012-10-24 20:50:28 CEST
Created attachment 4691 
do-not-mount-after-eject.patch

Ok, I had some fun with shortcuts-pane-view.c. Last time I didn't get that far. It's as I thought: First the eject code gets executed, but then instead of stopping there, thunar tries to open the "shortcut" in the same window.

Here's an easy solution which shouldn't cause any troubles.

For the tree view, it's not as easy, but maybe I'll get to it tomorrow.
Comment 5 Nick Schermer editbugs 2012-10-24 21:12:40 CEST
Mm good one, pushed the patch.

Bug #9403

Reported by:
Harald Judt
Reported on: 2012-10-22
Last modified on: 2012-10-29

People

Assignee:
Jannis Pohlmann
CC List:
1 user

Version

Attachments

do-not-mount-after-eject.patch (1.19 KB, patch)
2012-10-24 20:50 CEST , Harald Judt
no flags

Additional information