summaryrefslogtreecommitdiffstats
path: root/libmount/src/context_umount.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 19:23:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 19:23:00 +0000
commit803b3a091c225d48395508a8f9ffa6e08cbddc5b (patch)
treea3168c9e7da8991c423b5978aacf90c3c2b135c1 /libmount/src/context_umount.c
parentReleasing progress-linux version 2.40-8~progress7.99u1. (diff)
downloadutil-linux-803b3a091c225d48395508a8f9ffa6e08cbddc5b.tar.xz
util-linux-803b3a091c225d48395508a8f9ffa6e08cbddc5b.zip
Merging upstream version 2.40.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libmount/src/context_umount.c')
-rw-r--r--libmount/src/context_umount.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c
index 79b6237..bf70ed2 100644
--- a/libmount/src/context_umount.c
+++ b/libmount/src/context_umount.c
@@ -267,6 +267,9 @@ static int lookup_umount_fs_by_statfs(struct libmnt_context *cxt, const char *tg
* So, let's use statfs() if possible (it's bad idea for --lazy/--force
* umounts as target is probably unreachable NFS, also for --detach-loop
* as this additionally needs to know the name of the loop device).
+ *
+ * For the "umount --read-only" command, we need to read the mountinfo
+ * to obtain the mount source.
*/
if (mnt_context_is_restricted(cxt)
|| *tgt != '/'
@@ -275,6 +278,7 @@ static int lookup_umount_fs_by_statfs(struct libmnt_context *cxt, const char *tg
|| mnt_context_is_lazy(cxt)
|| mnt_context_is_nocanonicalize(cxt)
|| mnt_context_is_loopdel(cxt)
+ || mnt_context_is_rdonly_umount(cxt)
|| mnt_safe_stat(tgt, &st) != 0 || !S_ISDIR(st.st_mode)
|| has_utab_entry(cxt, tgt))
return 1; /* not found */