Summary: | Clicking on device of which a subdir is bound opens that bound subdir instead of the device's root | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-solid | Reporter: | Sybren Stüvel <sybren> |
Component: | general | Assignee: | Lukáš Tinkl <lukas> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | a.samirh78, buddhi1980, bugreporter42, g9879242, grahamperrin, kdelibs-bugs, krumphauchicken, nate, pmargeti34, solazs, soltesz.balazs.91 |
Priority: | NOR | ||
Version: | 5.83.0 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/frameworks/solid/commit/ef0b0dfa00b1de70c6d8e6913bbfdb79e7d3d1b6 | Version Fixed In: | 5.84 |
Sentry Crash Report: |
Description
Sybren Stüvel
2015-06-26 10:40:08 UTC
This bug exists in Kubuntu 15.10 too: Dolphin 15.07.90 KDE Frameworks 5.13.0 KDE Plasma 5.3.95 Steps to reproduce: boot kubuntu live dvd sudo su mkdir /mnt/test mount -t auto /dev/sda1 /mnt/test mkdir /home/kubuntu/test mount /mnt/test/somedir /home/kubuntu/test -o bind open Dolphin clicking on the device opens /home/kubuntu/test (/mnt/test/somedir) instead of /mnt/test This is most likely due to the fact that libsolid only can handle 1 mountpoint per device (and does not check if it is a bound mount): There is a "FIXME" in the source code of libsolid ;-) This bug is present on Kubuntu 15.04 and Arch Linux as well still an issue in kubuntu 5.5.0 Still an issue. Please confirm this bug. I've noticed it since 5.2 or earlier, and I think the reason there are so few comments here is because it's difficult to word correctly to get a result in Google. I can confirm it is still present in 5.7 on Fedora 24. Clicking on the device name in the Dolphin sidebar will move the user to the last directory bound to the device in fstab rather than the device root. This bug is still present in KDE. +1 for Brian, please confirm this bug. It is 100% reproduceable. Versions: plasma: 5.8.3 KDE Frameworks: 5.27.0 Qt: 5.7.0 On Arch Linux x86_64, kernel 4.8.7 It still happen in KDE Frameworks 5.28 I use following binds in fstab (to save space and reduce traffic on SSD drive): /media/data/var /var none bind 0 0 /media/data/tmp /tmp none bind 0 0 It produces the same problem as reported here. When I try to open "data" in Dolphin (from devices list), it goes to /media/data/tmp instead of /media/data *** This bug has been confirmed by popular vote. *** It's still broken. This looks non-trivial to fix, the udisks2 interfaces don't appear to have the required information in a reasonably digestable form. org.freedesktop.UDisks2.Filesystem has a MountPoints property that returns an alphabetically sorted list of mountpoints for a block device, including bind mounts. As far as I can tell, it's impossible to tell which of the mountpoints in the list is the mount point where the device was mounted using the udisks2 interfaces. (You can do a 'udisksctl dump' to get the info udisks2 provides.) udisks2 bug report: https://github.com/storaged-project/udisks/issues/478 Thank you for that command. I store media on a separate partition that I can share with my Windows boot, and bind those folders to the respective home directories. So `udiskctl dump` shows org.freedesktop.UDisks2.Filesystem: MountPoints: /home/frick/Music /home/frick/Pictures /home/frick/Videos /mnt/Share When clicking on the device in the sidebar, Dolphin will open Music (first in MountPoints, not last in fstab as I had thought). But (just me guessing) I think most desktop users using bind mounts are going to configure them in fstab, and that adds a "Configuration" dictionary at the top of the block with a 'dir' element storing the original device's mount point (for me, that's 'dir': <b'/mnt/Share'>). If the udisks issue isn't fixed, I think taking the path from 'dir', or, if not found, the shortest path from MountPoints would cover most cases. (In reply to Brian Frick from comment #11) > Thank you for that command. I store media on a separate partition that I can > share with my Windows boot, and bind those folders to the respective home > directories. So `udiskctl dump` shows > > org.freedesktop.UDisks2.Filesystem: > MountPoints: /home/frick/Music > /home/frick/Pictures > /home/frick/Videos > /mnt/Share > > When clicking on the device in the sidebar, Dolphin will open Music (first > in MountPoints, not last in fstab as I had thought). > > But (just me guessing) I think most desktop users using bind mounts are > going to configure them in fstab, and that adds a "Configuration" dictionary > at the top of the block with a 'dir' element storing the original device's > mount point (for me, that's 'dir': <b'/mnt/Share'>). If the udisks issue > isn't fixed, I think taking the path from 'dir', or, if not found, the > shortest path from MountPoints would cover most cases. Good points made here, my use case for bind mounts is indeed fstab setup for xdg_dirs on a shared ntfs mount. My workaround for this bug was creating an additional bind mount for the drive itself pointing to a hidden folder in my home directory. This correctly opens drive root in dolphin et al but it's hacky and I'd much rather see a proper solution in the form of fstab being parsed like Brian Frick suggested. A possibly relevant merge request was started @ https://invent.kde.org/frameworks/solid/-/merge_requests/37 *** Bug 352179 has been marked as a duplicate of this bug. *** Git commit ef0b0dfa00b1de70c6d8e6913bbfdb79e7d3d1b6 by Ahmad Samir. Committed on 23/06/2021 at 09:16. Pushed by ahmadsamir into branch 'master'. Find the base mount point of a partition that has bind mounts With bind mounts on Linux, UDisks returns a 'MountPoints' property that could include several paths, try to get the actual mount point of the partition and ignore bind mounts. Inspired by the approach used by GNOME's gio, use libmount to parse "/proc/self/mountinfo" and check the path returned by mnt_fs_get_root(), for the base partition this should return "/", for bind mounts it returns a dir e.g. /mnt/dirA/. This fixes a bug where clicking a Device icon in the Places panel could open the path of one of the bind mounts instead of the actual/base partition mount point, which is confusing to say the least. For more details: https://invent.kde.org/frameworks/solid/-/merge_requests/37 https://gitlab.gnome.org/GNOME/glib/-/issues/1271#note_352412 https://gitlab.gnome.org/GNOME/glib/-/commit/e1fa5ffb91e74376394fe17612015d44fec82366 https://github.com/storaged-project/udisks/issues/478 FIXED-IN: 5.84 M +5 -0 CMakeLists.txt M +4 -0 src/solid/devices/backends/udisks2/CMakeLists.txt M +53 -8 src/solid/devices/backends/udisks2/udisksstorageaccess.cpp M +2 -0 src/solid/devices/config-solid.h.cmake https://invent.kde.org/frameworks/solid/commit/ef0b0dfa00b1de70c6d8e6913bbfdb79e7d3d1b6 Thank you Ahmad for fixing this! The bug report was very informative, i.e. the bug reporters investigated the issue pretty well ;) |