Skip to content

udisks2: Restore support of comment=x-gvfs-* option

Ondrej Holy requested to merge wip/oholy/udisks-comment into master

Beginning the commit 959db3e0, mtab-based mount options are prioritized prior to the fstab options. However, "comment" option is not propagated to mtab and thus mounts with "comment=x-gvfs-show" can be ignored, but volumes can be still shown for them and vice versa. Consequently, mount operation fails with the following:

"Mount is denied because the NTFS volume is already exclusively opened. The volume may be already mounted, or another software may use it which could be identified for example by the help of the 'fuser' command."

Just a note, that "comment=x-gvfs-" is wrong as per the docs and it should be "comment=gvfs-" instead. However, it seems that the people started using this after commit 37d4bf32 as workaround on distributions with old util-linux versions, where plain "x-gvfs-*" option caused the following error:

"Unrecognized mount option "x-gvfs-show" or missing value"

The workaround using "comment=x-gvfs-*" option worked so far just only thanks to the "bug" in gvfs_udisks2_utils_lookup_fstab_options_value() function, which doesn't care about the prefix of the mount option.

Let's prioritize fstab options before mtab-based mount options to fix this regression. It is maybe less reliable because the assignment of the corresponding fstab entry is arguable, but the rest of the volume monitor code relies on it anyway.

Closes: #348 (closed)

Merge request reports