fix utab after external update#2607
Merged
karelzak merged 5 commits intoutil-linux:masterfrom Dec 5, 2023
Merged
Conversation
The function compares two options strings and returns options which are missing. Signed-off-by: Karel Zak <kzak@redhat.com>
libmount is able to add missing entry to /run/mount/utab after external /sbin/mouht.<type> helper execution. This is not enough, it's possible that the helper write proper entry to the utab, but there is missing some options expected by libmount (usually because the options are irrelevant fro the helper. Reproducer: Create a stupid mount.foo which writes x-foo=123 to utab: # echo -e '#!/bin/bash\n\n/bin/mount -i "$1" "$2" -o x-foo=123' > /sbin/mount.foo # chmod +x /sbin/mount.foo Run mount which needs to write x-bar=BAR options to utab and executes the helper (due to "-t foo", /dev/sdc1 is ext4): # mount -t foo /dev/sdc1 /mnt/test -o x-bar=BAR old mount: # cat /run/mount/utab ID=121 SRC=/dev/sdc1 TARGET=/mnt/test ROOT=/ OPTS=x-foo=123 fixed mount: # cat /run/mount/utab ID=121 SRC=/dev/sdc1 TARGET=/mnt/test ROOT=/ OPTS=x-foo=123,x-bar=BAR Fixes: util-linux#2554 Signed-off-by: Karel Zak <kzak@redhat.com>
8b5e5ea to
477401f
Compare
t-8ch
added a commit
to t-8ch/util-linux
that referenced
this pull request
Nov 29, 2023
See util-linux#2607 Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
See util-linux#2607 Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
f7a8e9b to
9ed0195
Compare
* remove optional ID= field (not on systems without statx()) * add missing tests/expected/mount/special-missing-options * make sure utab is created * use udevadm settle to wait for systemd Signed-off-by: Karel Zak <kzak@redhat.com>
9ed0195 to
201bc72
Compare
Collaborator
Author
|
I don't understand this (ubuntu 18): It seems utab does not exist or is empty, although explicitly created in the test; and umount(2) syscall ends with EPERM. @t-8ch any idea what is wrong with the test? |
Member
|
No clue right now, maybe LIBMOUNT_DEBUG would help. |
t-8ch
reviewed
Dec 1, 2023
| # This util-linux regression test component | ||
| # It's safe to remove me... | ||
| # | ||
| $TS_CMD_MOUNT -t tmpfs -i "\$1" "\$2" -o x-foo=123 |
Member
There was a problem hiding this comment.
here could be an exec to pass through the status code
Collaborator
Author
|
So... it passed on Ubuntu 18 with |
Signed-off-by: Karel Zak <kzak@redhat.com>
f2fe531 to
4e1d7bf
Compare
schubi2
pushed a commit
to schubi2/util-linux
that referenced
this pull request
Jan 18, 2024
See util-linux#2607 Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
gnomesysadmins
pushed a commit
to GNOME/glib
that referenced
this pull request
Jan 22, 2024
The `GUnixMountMonitor` object implements monitoring on its own currently. Only the `/proc/mounts` file changes are monitored. It is not aware of the `/run/mount/utab` file changes. This file contains the userspace mount options (e.g. `x-gvfs-notrash`, `x-gvfs-hide`) among others. There is a problem when `/sbin/mount.<type>` (e.g. `mount.nfs`) helper programs are used. In that case, the `/run/mount/utab` file is updated later than the `/proc/mounts` file and thus the `GUnixMountMonitor` clients (e.g. `gvfs-udisks2-volume-monitor`, `gvfsd-trash`) don't see the userspace options until the next `mount-changed` signal. Let's use the `libmnt_monitor` API for monitoring instead and emit the `mount-changed` signal also when the `/run/mount/utab` file is changed. Related: https://issues.redhat.com/browse/RHEL-14607 Related: util-linux/util-linux#2607
gnomesysadmins
pushed a commit
to GNOME/glib
that referenced
this pull request
Jan 31, 2024
The `GUnixMountMonitor` object implements monitoring on its own currently. Only the `/proc/mounts` file changes are monitored. It is not aware of the `/run/mount/utab` file changes. This file contains the userspace mount options (e.g. `x-gvfs-notrash`, `x-gvfs-hide`) among others. There is a problem when `/sbin/mount.<type>` (e.g. `mount.nfs`) helper programs are used. In that case, the `/run/mount/utab` file is updated later than the `/proc/mounts` file and thus the `GUnixMountMonitor` clients (e.g. `gvfs-udisks2-volume-monitor`, `gvfsd-trash`) don't see the userspace options until the next `mount-changed` signal. Let's use the `libmnt_monitor` API for monitoring instead and emit the `mount-changed` signal also when the `/run/mount/utab` file is changed. Related: https://issues.redhat.com/browse/RHEL-14607 Related: util-linux/util-linux#2607
gnomesysadmins
pushed a commit
to GNOME/glib
that referenced
this pull request
Jan 31, 2024
The `GUnixMountMonitor` object implements monitoring on its own currently. Only the `/proc/mounts` file changes are monitored. It is not aware of the `/run/mount/utab` file changes. This file contains the userspace mount options (e.g. `x-gvfs-notrash`, `x-gvfs-hide`) among others. There is a problem when `/sbin/mount.<type>` (e.g. `mount.nfs`) helper programs are used. In that case, the `/run/mount/utab` file is updated later than the `/proc/mounts` file and thus the `GUnixMountMonitor` clients (e.g. `gvfs-udisks2-volume-monitor`, `gvfsd-trash`) don't see the userspace options until the next `mount-changed` signal. Let's use the `libmnt_monitor` API for monitoring instead and emit the `mount-changed` signal also when the `/run/mount/utab` file is changed. Related: https://issues.redhat.com/browse/RHEL-14607 Related: util-linux/util-linux#2607
gnomesysadmins
pushed a commit
to GNOME/glib
that referenced
this pull request
Jan 31, 2024
The `GUnixMountMonitor` object implements monitoring on its own currently. Only the `/proc/mounts` file changes are monitored. It is not aware of the `/run/mount/utab` file changes. This file contains the userspace mount options (e.g. `x-gvfs-notrash`, `x-gvfs-hide`) among others. There is a problem when `/sbin/mount.<type>` (e.g. `mount.nfs`) helper programs are used. In that case, the `/run/mount/utab` file is updated later than the `/proc/mounts` file and thus the `GUnixMountMonitor` clients (e.g. `gvfs-udisks2-volume-monitor`, `gvfsd-trash`) don't see the userspace options until the next `mount-changed` signal. Let's use the `libmnt_monitor` API for monitoring instead and emit the `mount-changed` signal also when the `/run/mount/utab` file is changed. Related: https://issues.redhat.com/browse/RHEL-14607 Related: util-linux/util-linux#2607
ahmed-masud
pushed a commit
to safai-labs/util-linux
that referenced
this pull request
Feb 23, 2024
See util-linux#2607 Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
havardgraff
pushed a commit
to pexip/glib
that referenced
this pull request
Nov 17, 2025
The `GUnixMountMonitor` object implements monitoring on its own currently. Only the `/proc/mounts` file changes are monitored. It is not aware of the `/run/mount/utab` file changes. This file contains the userspace mount options (e.g. `x-gvfs-notrash`, `x-gvfs-hide`) among others. There is a problem when `/sbin/mount.<type>` (e.g. `mount.nfs`) helper programs are used. In that case, the `/run/mount/utab` file is updated later than the `/proc/mounts` file and thus the `GUnixMountMonitor` clients (e.g. `gvfs-udisks2-volume-monitor`, `gvfsd-trash`) don't see the userspace options until the next `mount-changed` signal. Let's use the `libmnt_monitor` API for monitoring instead and emit the `mount-changed` signal also when the `/run/mount/utab` file is changed. Related: https://issues.redhat.com/browse/RHEL-14607 Related: util-linux/util-linux#2607
gnomesysadmins
pushed a commit
to GNOME/glib
that referenced
this pull request
Jan 19, 2026
The `GUnixMountMonitor` object implements monitoring on its own currently. Only the `/proc/mounts` file changes are monitored. It is not aware of the `/run/mount/utab` file changes. This file contains the userspace mount options (e.g. `x-gvfs-notrash`, `x-gvfs-hide`) among others. There is a problem when `/sbin/mount.<type>` (e.g. `mount.nfs`) helper programs are used. In that case, the `/run/mount/utab` file is updated later than the `/proc/mounts` file and thus the `GUnixMountMonitor` clients (e.g. `gvfs-udisks2-volume-monitor`, `gvfsd-trash`) don't see the userspace options until the next `mount-changed` signal. Let's use the `libmnt_monitor` API for monitoring instead and emit the `mount-changed` signal also when the `/run/mount/utab` file is changed. Related: https://issues.redhat.com/browse/RHEL-14607 Related: util-linux/util-linux#2607
gnomesysadmins
pushed a commit
to GNOME/glib
that referenced
this pull request
Jan 22, 2026
The `GUnixMountMonitor` object implements monitoring on its own currently. Only the `/proc/mounts` file changes are monitored. It is not aware of the `/run/mount/utab` file changes. This file contains the userspace mount options (e.g. `x-gvfs-notrash`, `x-gvfs-hide`) among others. There is a problem when `/sbin/mount.<type>` (e.g. `mount.nfs`) helper programs are used. In that case, the `/run/mount/utab` file is updated later than the `/proc/mounts` file and thus the `GUnixMountMonitor` clients (e.g. `gvfs-udisks2-volume-monitor`, `gvfsd-trash`) don't see the userspace options until the next `mount-changed` signal. Let's use the `libmnt_monitor` API for monitoring instead and emit the `mount-changed` signal also when the `/run/mount/utab` file is changed. Related: https://issues.redhat.com/browse/RHEL-14607 Related: util-linux/util-linux#2607
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #2554
Please take a look at the commit message of the second patch.