Bug 413475 - Dolphin detects wrong location for device if it is bind-mounted
Summary: Dolphin detects wrong location for device if it is bind-mounted
Status: REPORTED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 19.08.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-26 13:50 UTC by Kishore Gopalakrishnan
Modified: 2023-07-22 17:04 UTC (History)
2 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 Kishore Gopalakrishnan 2019-10-26 13:50:49 UTC
SUMMARY
I have a partition in which certain folders are bind-mounted to folders in my home directory. When I click this device in the dolphin sidebar, it opens one of the folders which have been bind-mounted, instead of the actual device.
The directory structure is schematically as follows:

/run/media/kishore/oldhome (mountpoint of the partition, which is named `Arch-home`)
|- Documents
|- some other directories

`Documents` is bind-mounted to /home/kishore/Documents 

STEPS TO REPRODUCE:
1. Mount a partition (say 'Arch-home') which has multiple folders.
2. Bind-mount one of the folders (say 'Documents') to a folder in your home directory.
3. Click on the partition name in the 'devices' section of Dolphin's sidebar.

OBSERVED RESULT
When I click the item labelled 'Arch-home' in the dolphin sidebar (it appears under 'Devices'), I am taken to /home/kishore/Documents, instead of /run/media/kishore/oldhome (Note that the contents of these two locations are not the same, so it is not merely about displaying the right path in the addressbar.)

EXPECTED RESULT
Dolphin should correctly open the actual partition.

SOFTWARE/OS VERSIONS
Linux distro: Arch Linux
KDE Plasma Version: 5.17.0
KDE Frameworks Version: 5.63.0
Qt Version: 5.13.1

ADDITIONAL INFORMATION
Bug 330563 is a similar bug, but for krusader.

Relevant portion of fstab:
#Old home.
UUID=9ae18791-bede-41a9-904f-dbea4d3993da   /run/media/kishore/oldhome  ext4    defaults,rw,relatime,nofail     0 0
#Bind mounts for ~
/run/media/kishore/oldhome/kishore/Downloads    /home/kishore/Downloads none    defaults,bind,uid=1000,gid=1000,nofail    0 0
/run/media/kishore/oldhome/kishore/Documents    /home/kishore/Documents none    defaults,bind,uid=1000,gid=1000,nofail    0 0
/run/media/kishore/oldhome/kishore/Pictures /home/kishore/Pictures  none    defaults,bind,uid=1000,gid=1000,nofail    0 0
/run/media/kishore/oldhome/kishore/build    /home/kishore/build none    defaults,bind,uid=1000,gid=1000,nofail    0 0

Output of `mount -t ext4`
```
/dev/sda2 on / type ext4 (rw,relatime)
/dev/sda3 on /home type ext4 (rw,relatime,data=ordered)
/dev/sdb14 on /run/media/kishore/oldhome type ext4 (rw,relatime)
/dev/sdb14 on /home/kishore/Documents type ext4 (rw,relatime)
/dev/sdb14 on /home/kishore/Downloads type ext4 (rw,relatime)
/dev/sdb14 on /home/kishore/Pictures type ext4 (rw,relatime)
/dev/sdb14 on /home/kishore/build type ext4 (rw,relatime)
```

Output of `lsblk`
```
NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda       8:0    0 111.8G  0 disk 
├─sda1    8:1    0   512M  0 part 
├─sda2    8:2    0    50G  0 part /
├─sda3    8:3    0  49.3G  0 part /home
└─sda4    8:4    0    12G  0 part [SWAP]
sdb       8:16   0 931.5G  0 disk 
├─sdb1    8:17   0   500M  0 part /boot
├─sdb2    8:18   0    40M  0 part 
├─sdb3    8:19   0   128M  0 part 
├─sdb4    8:20   0   750M  0 part 
├─sdb5    8:21   0    70G  0 part 
├─sdb7    8:23   0 734.7G  0 part /run/media/kishore/Files
├─sdb12   8:28   0   8.4G  0 part 
├─sdb13   8:29   0    35G  0 part 
├─sdb14   8:30   0    70G  0 part /run/media/kishore/oldhome
└─sdb16 259:0    0    12G  0 part [SWAP]

```

If I type the actual mountpoint into the addressbar, it shows me the correct location as expected.
Comment 1 Marco Rebhan 2023-07-22 17:04:01 UTC
Still an issue in 23.04.3. Encountering this on a NixOS "root on tmpfs" setup (https://github.com/nix-community/impermanence), where various paths including files are bind-mounted from a subdirectory of /nix (the original mount point of the persistent drive /dev/nvme0n1p2). In my case, dolphin tries to open /etc/krb5.keytab instead of /nix.

lsblk output:

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 232.9G  0 disk 
└─bcache0   253:0    0   3.6T  0 disk /home
sdb           8:16   0 111.8G  0 disk 
sdc           8:32   0   3.6T  0 disk 
└─bcache0   253:0    0   3.6T  0 disk /home
sr0          11:0    1 367.8M  0 rom  
nvme0n1     259:0    0 232.9G  0 disk 
├─nvme0n1p1 259:1    0   512M  0 part /boot
└─nvme0n1p2 259:2    0 232.4G  0 part /var/log/journal
                                      /var/lib/systemd
                                      /var/lib/swap
                                      /var/lib/private/anisette-server
                                      /var/lib/openvpn-gamevpn
                                      /var/lib/lockdown
                                      /var/lib/libvirt
                                      /var/lib/cups
                                      /var/lib/bluetooth
                                      /var/lib/alsa
                                      /var/lib/AccountsService
                                      /var/keys
                                      /tmp
                                      /root
                                      /etc/nixos
                                      /var/log/wtmp
                                      /var/log/btmp
                                      /etc/machine-id
                                      /etc/krb5.keytab
                                      /nix/store
                                      /var/lib/nixos
                                      /nix