Bug 422082 - Using mountiso plugin unmount action on a mounted loop device does not remove the loop device
Summary: Using mountiso plugin unmount action on a mounted loop device does not remove...
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: plugins: ISO mounting (show other bugs)
Version: 20.04.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Kwon-Young Choi
URL:
Keywords:
: 424410 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-05-26 08:08 UTC by Kwon-Young Choi
Modified: 2020-11-12 00:35 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 20.12


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kwon-Young Choi 2020-05-26 08:08:38 UTC
SUMMARY

This concerns the mountiso dolphin-plugins but I could not find the correct components.
This bug concerns the unmount behavior of the mountiso plugin.

Before starting, here is a schema of the workflow used to mount an iso file as a
directory using the mountiso plugin in dolphin:

 mountiso mount/unmount action      dolphin sidebar mount/unmount action
              |             automatic               |
myimage.iso -----> /dev/loop0 -----> /dev/loop0p1 -----> /run/media/user/myimage

The problem here is that you can't delete the /dev/loop0 device if /dev/loop0p1 is already mounted on /run/media/user/myimage.

I already have a patch for the mountiso plugin to unmount the /dev/loop0p1 device before deleting /dev/loop0 and I'll make a merge request soon.

Additional questions:

* Should the mount action of the mountiso plugin automatically mount the /dev/loop0p1 device to a directory?
* Should the unmount action of dolphin sidebar automatically delete the /dev/loop0 device?

I have already tried to automatically mount /dev/loop0p1 device to a directory when mounting using mountiso action, but I can't make it to work.
After mounting the iso file to /dev/loop0, I can get the corresponding /dev/loop0p1 device but it seems that Solid does not consider to be a StorageAccess device, which means that I can't mount it to a directory.

STEPS TO REPRODUCE
1. Mount iso file using mountiso mount action
2. Click on the newly appeared device on dolphin side bar (as a results, new device is mounted on a directory)
3. Go back to iso file, unmount using mountiso unmount action

OBSERVED RESULT

The device on dolphin side bar does not disappear.
When the user unmount the device from dolphin side bar, the device disappear automatically.

EXPECTED RESULT

The device disappear from dolphin sidebar.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.6.12-1-MANJARO
(available in About System)
KDE Plasma Version: latest build from source
KDE Frameworks Version: latest build from source
Qt Version: 5.14.2
Comment 1 Kwon-Young Choi 2020-07-20 09:58:29 UTC
*** Bug 424410 has been marked as a duplicate of this bug. ***
Comment 3 Kwon-Young Choi 2020-11-11 22:48:49 UTC
Git commit f4e7a1b8a1fa74f7a0d47d85f702ffbc201423d8 by Kwon-Young Choi.
Committed on 11/11/2020 at 11:07.
Pushed by elvisangelaccio into branch 'release/20.12'.

Autmatically unmount mounted directory when deleting loop device

When deleting a loop device, all mounts depending on this loop device
should be unmounted before deletion.
This patch uses Solid to get all StorageAccess devices linked to the loop
device to delete and unmounts them if needed before the loop devie
deletion.

M  +22   -7    mountiso/mountisoaction.cpp

https://invent.kde.org/sdk/dolphin-plugins/commit/f4e7a1b8a1fa74f7a0d47d85f702ffbc201423d8