Bug 319998 - Deleted loop devices still listed
Summary: Deleted loop devices still listed
Status: RESOLVED FIXED
Alias: None
Product: frameworks-solid
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Lukáš Tinkl
URL:
Keywords:
: 320573 331601 369434 (view as bug list)
Depends on:
Blocks: 388360
  Show dependency treegraph
 
Reported: 2013-05-18 22:05 UTC by Erwin Mueller
Modified: 2019-02-08 22:24 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Solid hardware list before and after. (11.14 KB, text/plain)
2013-07-29 08:19 UTC, Erwin Mueller
Details
Dolphin places with devices (23.08 KB, image/png)
2013-07-29 08:20 UTC, Erwin Mueller
Details
Dolphin window a) before creating, b) after deleting (8.02 KB, image/png)
2013-08-10 15:27 UTC, Erwin Mueller
Details
before creating loop-device (14.95 KB, text/plain)
2013-08-31 14:43 UTC, Erwin Mueller
Details
Loop-device created, loop showing in Dolphin (23.32 KB, text/plain)
2013-08-31 14:44 UTC, Erwin Mueller
Details
Removed loop device, still showing in Dolphin (23.13 KB, text/plain)
2013-08-31 14:45 UTC, Erwin Mueller
Details
Output requested in comment #21 (3.81 KB, text/plain)
2014-03-01 13:17 UTC, kdebugs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erwin Mueller 2013-05-18 22:05:00 UTC
The devices list still list deleted Loop Devices.
How to reproduce:
dd if=/dev/zero of=test.dd bs=1M count=1
sudo losetup --find --show /home/devent/test.dd
Dolphin now shows "Loop Device" in "Devices".
sudo losetup -d /dev/loop0
sudo losetup -a
No loop devices found. But Dolphin still shows "Loop Device" in "Devices".
Comment 1 Frank Reininghaus 2013-05-22 06:13:54 UTC
Thanks for the report. I think that this is most likely a Solid issue (this is the library that tells us about the available devices).
Comment 2 Frank Reininghaus 2013-06-01 20:52:36 UTC
*** Bug 320573 has been marked as a duplicate of this bug. ***
Comment 3 Alex Fiestas 2013-07-28 22:40:16 UTC
Can you reproduce the bug and execute:
solid-hardware list

before and after?

Thanks !
Comment 4 Erwin Mueller 2013-07-29 08:19:55 UTC
Created attachment 81413 [details]
Solid hardware list before and after.
Comment 5 Erwin Mueller 2013-07-29 08:20:32 UTC
Created attachment 81414 [details]
Dolphin places with devices
Comment 6 Erwin Mueller 2013-07-29 08:21:49 UTC
I put the commands and output in the attached text file.
KDE 4.10.4
Dolphin 2.2
Comment 7 Alex Fiestas 2013-07-29 13:04:54 UTC
In 4.11 nothing shows in dolphin, which at least given your command line is the intended behavior since dolphin can't do anything with a device without FS.

Should we close this bug ?
Comment 8 Erwin Mueller 2013-07-29 14:37:15 UTC
I just observed something.
When I close Dolphin and open Dolphin again then the deleted loop device is gone. That was not the case when I opened the bug report in 4.10.3. But you have to close and open Dolphin, because the already opened Dolphin windows still have the deleted loop device in Places/Devices. It's not critical bug now because you can just close and open Dolphin if there are too many invalid devices.
Comment 9 Christoph Feck 2013-08-10 14:19:53 UTC
Does this mean the issue is in Dolphin, not reacting to Solid signals?
Comment 10 Erwin Mueller 2013-08-10 15:27:47 UTC
Created attachment 81631 [details]
Dolphin window a) before creating, b) after deleting

I don't know. I tested again with KDE 4.10.5, same behaviour. I attach a screen shot showing two Dolphin windows, one open before the creation of the loop device, and one opened after the deletion. Both windows should not show the deleted loop device.
Comment 11 Frank Reininghaus 2013-08-12 09:21:30 UTC
(In reply to comment #9)
> Does this mean the issue is in Dolphin, not reacting to Solid signals?

Dolphin does listen to Solid's deviceAdded and deviceRemoved signals.
Comment 12 Alex Fiestas 2013-08-12 10:55:14 UTC
Are you using 4.11 now? if not, can you give it a try (using latest RC, for example on a livecd) ?

Thanks !
Comment 13 Erwin Mueller 2013-08-14 13:32:07 UTC
I'm using 4.10.
Can you please point to me how can I test 4.11 on a livecd? My search in Google was not successful.
Comment 14 Jekyll Wu 2013-08-15 03:38:16 UTC
(In reply to comment #13)
> I'm using 4.10.
> Can you please point to me how can I test 4.11 on a livecd? My search in
> Google was not successful.

Try this openSUSE livecd :

http://download.opensuse.org/distribution/13.1-Milestone4/iso/openSUSE-Factory-KDE-Live-Build0652-x86_64.iso
Comment 15 Christoph Feck 2013-08-29 20:38:40 UTC
Erwin, any progress on testing with KDE 4.11?
Comment 16 Erwin Mueller 2013-08-30 18:59:25 UTC
Hello,
I tested it with OpenSuse with KDE 4.10.97 with Dolphin and I get the same behaviour like described in Comment 8 and Comment 10.
Comment 17 Alex Fiestas 2013-08-31 12:10:16 UTC
can you attach the output of udiskctl dump ?

Thanks
Comment 18 Erwin Mueller 2013-08-31 14:43:43 UTC
Created attachment 82059 [details]
before creating loop-device
Comment 19 Erwin Mueller 2013-08-31 14:44:32 UTC
Created attachment 82060 [details]
Loop-device created, loop showing in Dolphin
Comment 20 Erwin Mueller 2013-08-31 14:45:27 UTC
Created attachment 82061 [details]
Removed loop device, still showing in Dolphin

Sorry, I don't see how I can attach multiple files in one post.
Comment 21 Alex Fiestas 2013-08-31 18:25:00 UTC
I still can't reproduce this :/ let's try this:

look in solid-hardware list, for the device that losetup -find gave you (I 'm guessting that's the one shown in dolphin).

then do
solid-hardware deatils /org/freedesktop/....

And paste the output.

also, if you can execute dolphin and "solid-hardware listen" in a terminal, reproduce the bug and report the output will be nice as well.

Make sure to have everything containing "Dolphin" in kdebugdialgo checked.

Thanks !
Comment 22 Christoph Feck 2013-09-20 21:38:03 UTC
To further investigate this issue, KDE developers need the information requested in comment #21. If you can provide it, or need help with finding that information, please add a comment.
Comment 23 Frank Reininghaus 2014-03-01 11:29:39 UTC
*** Bug 331601 has been marked as a duplicate of this bug. ***
Comment 24 kdebugs 2014-03-01 13:17:16 UTC
Created attachment 85371 [details]
Output requested in comment #21

(In reply to comment #21)
> look in solid-hardware list, for the device that losetup -find gave you (I
> 'm guessting that's the one shown in dolphin).
> 
> then do
> solid-hardware deatils /org/freedesktop/....
> 
> And paste the output.
> 
> also, if you can execute dolphin and "solid-hardware listen" in a terminal,
> reproduce the bug and report the output will be nice as well.

See attachment.

> Make sure to have everything containing "Dolphin" in kdebugdialgo checked.
> 
I'm not sure what that means.
Comment 25 Christoph Feck 2014-03-12 20:50:22 UTC
Alex, does comment #24 provide the requested information? Please set the bug status.
Comment 26 Christoph Feck 2014-04-21 11:20:04 UTC
No response, changing status.
Comment 27 Lukas Ba. 2017-05-04 18:40:36 UTC
Duplicate:
https://bugs.kde.org/show_bug.cgi?id=369434
Comment 28 Kai Uwe Broulik 2018-01-23 15:30:28 UTC
*** Bug 369434 has been marked as a duplicate of this bug. ***
Comment 29 Kai Uwe Broulik 2018-01-23 16:19:48 UTC
Git commit 1384f275ab2f1ad1841753ee163af6d1b0bb952b by Kai Uwe Broulik.
Committed on 23/01/2018 at 16:06.
Pushed by broulik into branch 'master'.

[UDisks] Ignore non-user mounts

This gets rid of all those internal mounts, such as /snap mounts.
The approach is similar to GVFS which ignores everything outside /media, /home/user, and /media/run,
cf. https://github.com/GNOME/gvfs/blob/master/monitor/udisks2/what-is-shown.txt
Explicitly creating a mount in /etc/fstab outside of those directories is still possible and will always show up.
Related: bug 379516

CHANGELOG: Storage devices mounted outside of /media, /run/media, and $HOME are now ignored, as well as Loop Devices whose
backing file is outside of $HOME

Differential Revision: https://phabricator.kde.org/D9895

M  +10   -1    src/solid/devices/backends/udisks2/udisksstorageaccess.cpp
M  +13   -2    src/solid/devices/backends/udisks2/udisksstoragevolume.cpp

https://commits.kde.org/solid/1384f275ab2f1ad1841753ee163af6d1b0bb952b
Comment 30 Marco Leise 2018-01-23 20:31:10 UTC
I wish what the desktop environments do now didn't look so ad hoc. :)
The issue of filesystems staying in the places list (and AFAICT, plasmashell slowing down) is not fixed by this, there are just fewer real life cases that could trigger the problem. I.e. if I moved my systemd auto-mount from /usr/repos to $HOME/repos I would have to reopen this report.

My expectation was that KDE is properly informed by udisks about the disappearance of the loop device even if that means opening a bug report with the kernel. I don't have a deep understanding of the issue though.
Comment 31 Stefan Brüns 2018-04-08 18:23:39 UTC
(In reply to Marco Leise from comment #30)
> I wish what the desktop environments do now didn't look so ad hoc. :)
> The issue of filesystems staying in the places list (and AFAICT, plasmashell
> slowing down) is not fixed by this, there are just fewer real life cases
> that could trigger the problem. I.e. if I moved my systemd auto-mount from
> /usr/repos to $HOME/repos I would have to reopen this report.
> 
> My expectation was that KDE is properly informed by udisks about the
> disappearance of the loop device even if that means opening a bug report
> with the kernel. I don't have a deep understanding of the issue though.

There are two different aspects here:
1. Loop devices without backing file
2. User mounted loop devices (having a backing file)

The first should never be shown. If these are, it is a bug.

The second can only be handled in a heuristic way. The heuristic says when the user has mounted e.g. a iso image, it is sensible to make it accessible and findable by default.

Now, it is perfectly valid to have something permanent mounted in your home directory. But if you add this *manually*, you should go the full way and tell the infrastructure it should ignore it. This is easy to do, just add an x-gvfs-ignore=true hint to your filesystem options.
Comment 32 Stefan Brüns 2018-04-08 18:46:01 UTC
(In reply to Stefan Brüns from comment #31)
> 
> There are two different aspects here:
> 1. Loop devices without backing file
> 2. User mounted loop devices (having a backing file)
> 
> The first should never be shown. If these are, it is a bug.

Handling of the corresponding UDisks2 PropertiesChanged signal seems to be missing:
signal time=1523212908.677989 sender=:1.57505 -> destination=(null destination) serial=10250 path=/org/freedesktop/UDisks2; interface=org.freedesktop.DBus.ObjectManager; member=InterfacesRemoved
   object path "/org/freedesktop/UDisks2/block_devices/loop0"
   array [
      string "org.freedesktop.UDisks2.Filesystem"
   ]
signal time=1523212908.678019 sender=:1.57505 -> destination=(null destination) serial=10251 path=/org/freedesktop/UDisks2/block_devices/loop0; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.freedesktop.UDisks2.Block"
   array [
      dict entry(
         string "IdUUID"
         variant             string ""
      )
      dict entry(
         string "IdLabel"
         variant             string ""
      )
      dict entry(
         string "IdVersion"
         variant             string ""
      )
      dict entry(
         string "IdType"
         variant             string ""
      )
      dict entry(
         string "IdUsage"
         variant             string ""
      )
      dict entry(
         string "Size"
         variant             uint64 0
      )
      dict entry(
         string "Symlinks"
         variant             array [
            ]
      )
   ]
   array [
   ]
signal time=1523212908.678099 sender=:1.57505 -> destination=(null destination) serial=10252 path=/org/freedesktop/UDisks2/block_devices/loop0; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.freedesktop.UDisks2.Loop"
   array [
      dict entry(
         string "Autoclear"
         variant             boolean false
      )
      dict entry(
         string "BackingFile"
         variant             array of bytes "" + \0
      )
   ]
   array [
   ]
Comment 33 Stefan Brüns 2018-04-19 00:32:35 UTC
The places widget receives all necessary events, put does not deal correctly with devices changing from "accessible" to "hidden".

If a device does not have a filesystem at startup (e.g. an unused loop device), it is filtered out by the solid predicates, and thus hidden. When the loop device gets used by mounting a image, it will be added. The opposite, unmounting, does not have the opposing effect.
Comment 34 Andrew Crouthamel 2018-09-04 15:46:50 UTC
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years so I am closing this bug. Please try again with the latest version and submit a new bug to frameworks-solid if your issue persists. Thank you!
Comment 35 Stefan Brüns 2018-09-04 17:47:47 UTC
@ Andrew:
Who are you to decide what is maintained and what not? Look at the git log. And stop anoying developers and wasting their time by adding useless noise.
Comment 36 Nate Graham 2018-12-27 05:56:23 UTC
So is this still an issue? If so, it should be re-opened. I've moved the status back to RESOLVED so now anyone can.
Comment 37 Marco Leise 2018-12-27 16:07:20 UTC
(In reply to Nate Graham from comment #36)
> So is this still an issue? If so, it should be re-opened. I've moved the
> status back to RESOLVED so now anyone can.

My auto-mount device in /usr/repos is no longer showing up in Dolphin. This part is working now! I have not tried auto-mounts in $HOME or any of the other cases listed here.
Comment 38 Rolf Eike Beer 2019-02-08 22:24:28 UTC
I don't see any issues with loop devices with the latest versions anymore. Thanks everyone.