After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 793545 - gvfs is confused by PARTLABEL= entries in fstab
gvfs is confused by PARTLABEL= entries in fstab
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: udisks2 volume monitor
1.34.x
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2018-02-17 18:45 UTC by Mantas Mikulėnas (grawity)
Modified: 2018-02-20 08:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
udisks2: Add support for PARTLABEL and PARTUUID (3.35 KB, patch)
2018-02-19 17:07 UTC, Ondrej Holy
none Details | Review
udisks2: Fix UUID matching (1.50 KB, patch)
2018-02-19 17:07 UTC, Ondrej Holy
committed Details | Review
udisks2: Add support for PARTLABEL and PARTUUID (3.35 KB, patch)
2018-02-19 17:07 UTC, Ondrej Holy
committed Details | Review

Description Mantas Mikulėnas (grawity) 2018-02-17 18:45:50 UTC
I have these fstab entries:

PARTLABEL=sd.raindows	/C	ntfs	rw,fmask=0133,dmask=022,usermapping=/etc/usermap.raindows,x-gvfs-show,nofail 0 0
LABEL=hd.raindata	/D	ntfs	rw,fmask=0133,dmask=022,usermapping=/etc/usermap.raindows,x-gvfs-show,nofail 0 0

I noticed that while /D is shown correctly, /C shows up as *two* separate disks (in programs such as Baobab, Nautilus, Thunar) – the second instance being an unmounted volume.

It seems that find_volume_for_device() in gvfs' monitor/udisks2/gvfsudisks2volumemonitor.c only understands the LABEL= prefix but not PARTLABEL=...

gvfs 1.34.2
udisks2 2.7.6
Comment 1 Ondrej Holy 2018-02-19 17:07:20 UTC
Created attachment 368576 [details] [review]
udisks2: Add support for PARTLABEL and PARTUUID

Currently, PARTLABEL and PARTUUID is not handled and consequently redundant
GVfsUDisks2Volume is presented. Add support for them.
Comment 2 Ondrej Holy 2018-02-19 17:07:40 UTC
Created attachment 368577 [details] [review]
udisks2: Fix UUID matching

"device + 6" is used to skip "UUID=" prefix in the string, but it
should be "device + 5" since it has only 5 chars.
Comment 3 Ondrej Holy 2018-02-19 17:07:45 UTC
Created attachment 368578 [details] [review]
udisks2: Add support for PARTLABEL and PARTUUID

Currently, PARTLABEL and PARTUUID is not handled and consequently redundant
GVfsUDisks2Volume is presented. Add support for them.
Comment 4 Ondrej Holy 2018-02-19 17:08:34 UTC
Is there any chance that you can test the attached patches?
Comment 5 Mantas Mikulėnas (grawity) 2018-02-19 18:04:00 UTC
(In reply to Ondrej Holy from comment #2)
> Created attachment 368577 [details] [review] [review]
> udisks2: Fix UUID matching
> 
> "device + 6" is used to skip "UUID=" prefix in the string, but it
> should be "device + 5" since it has only 5 chars.

With the patch applied, everything I've tried works. But I'm a bit confused by the fact that in many cases UUID= *still* worked even without the patch (only a single FAT32 partition didn't)...
Comment 6 Mantas Mikulėnas (grawity) 2018-02-19 18:05:03 UTC
(In reply to Ondrej Holy from comment #3)
> Created attachment 368578 [details] [review] [review]
> udisks2: Add support for PARTLABEL and PARTUUID
> 
> Currently, PARTLABEL and PARTUUID is not handled and consequently redundant
> GVfsUDisks2Volume is presented. Add support for them.

Both PARTLABEL and PARTUUID work with this patch applied.
Comment 7 Ondrej Holy 2018-02-20 08:38:27 UTC
Thanks for testing!

(In reply to Mantas Mikulėnas (grawity) from comment #5)
> ...
> With the patch applied, everything I've tried works. But I'm a bit confused
> by the fact that in many cases UUID= *still* worked even without the patch
> (only a single FAT32 partition didn't)...

To be honest, I am also a little bit confused by this, but anyway "device + 6" is obviously wrong...
Comment 8 Ondrej Holy 2018-02-20 08:38:43 UTC
Comment on attachment 368577 [details] [review]
udisks2: Fix UUID matching

Attachment 368577 [details] pushed as 76e4121 - udisks2: Fix UUID matching
Comment 9 Ondrej Holy 2018-02-20 08:41:31 UTC
Attachment 368578 [details] pushed as 0ce3af8 - udisks2: Add support for PARTLABEL and PARTUUID