diff --git a/libmount-Avoid-triggering-autofs-in-lookup_umount_fs.patch b/libmount-Avoid-triggering-autofs-in-lookup_umount_fs.patch new file mode 100644 index 0000000..16832cb --- /dev/null +++ b/libmount-Avoid-triggering-autofs-in-lookup_umount_fs.patch @@ -0,0 +1,42 @@ +From 7065cc0e5312cafc5ae3e4c342f78f264300fb5f Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Wed, 1 Apr 2020 13:15:13 +0200 +Subject: [PATCH 1/4] libmount: Avoid triggering autofs in + lookup_umount_fs_by_statfs +References: boo#1168389 +Upstream: merged (gh#karelzak/util-linux#1002) + +Currently, umount /foo results in a statfs("/foo") call, which triggers +autofs. This can create another mountpoint on /foo, which is then unmounted +later instead of the actual /foo at the time umount was called. + +This is especially an issue for umount -R /bar, which just fails with +-EBUSY as the accidental mountpoint is never accounted for and so it tries +to umount /bar before /bar/someautofs. + +Replace the direct statfs call with open(path, O_PATH) + fstatfs, which sees +the autofs mount directly, without triggering it. +--- + libmount/src/context_umount.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +Index: util-linux-2.34/libmount/src/context_umount.c +=================================================================== +--- util-linux-2.34.orig/libmount/src/context_umount.c ++++ util-linux-2.34/libmount/src/context_umount.c +@@ -283,9 +283,13 @@ static int lookup_umount_fs(struct libmn + if (!type) { + struct statfs vfs; + +- DBG(CXT, ul_debugobj(cxt, "umount: trying statfs()")); +- if (statfs(tgt, &vfs) == 0) ++ DBG(CXT, ul_debugobj(cxt, "umount: trying fstatfs()")); ++ /* O_PATH avoids triggering automount points. */ ++ int pathfd = open(tgt, O_PATH); ++ if (pathfd >= 0 && fstatfs(pathfd, &vfs) == 0) { + type = mnt_statfs_get_fstype(&vfs); ++ close(pathfd); ++ } + if (type) { + rc = mnt_fs_set_fstype(cxt->fs, type); + if (rc) diff --git a/python3-libmount.spec b/python3-libmount.spec index 578343f..116db46 100644 --- a/python3-libmount.spec +++ b/python3-libmount.spec @@ -1,7 +1,7 @@ # # spec file for package python3-libmount # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -124,7 +124,7 @@ BuildRequires: libmount-devel #END SECOND STAGE DEPENDENCIES Version: 2.34 Release: 0 -Url: https://www.kernel.org/pub/linux/utils/util-linux/ +URL: https://www.kernel.org/pub/linux/utils/util-linux/ Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.34/util-linux-%{version}.tar.xz Source1: util-linux-rpmlintrc Source2: util-linux-login_defs-check.sh diff --git a/util-linux-systemd.spec b/util-linux-systemd.spec index 5da0245..071ea2b 100644 --- a/util-linux-systemd.spec +++ b/util-linux-systemd.spec @@ -1,7 +1,7 @@ # # spec file for package util-linux-systemd # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -124,7 +124,7 @@ BuildRequires: libmount-devel #END SECOND STAGE DEPENDENCIES Version: 2.34 Release: 0 -Url: https://www.kernel.org/pub/linux/utils/util-linux/ +URL: https://www.kernel.org/pub/linux/utils/util-linux/ Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.34/util-linux-%{version}.tar.xz Source1: util-linux-rpmlintrc Source2: util-linux-login_defs-check.sh diff --git a/util-linux.changes b/util-linux.changes index fed1632..8e38215 100644 --- a/util-linux.changes +++ b/util-linux.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Apr 6 14:47:56 UTC 2020 - Ignaz Forster + +- Add libmount-Avoid-triggering-autofs-in-lookup_umount_fs.patch: + Avoid triggering autofs in lookup_umount_fs_by_statfs + (boo#1168389) + ------------------------------------------------------------------- Tue Oct 8 14:48:15 CEST 2019 - kukuk@suse.de diff --git a/util-linux.spec b/util-linux.spec index 3546237..bc92281 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -1,7 +1,7 @@ # # spec file for package util-linux # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -124,7 +124,7 @@ BuildRequires: libmount-devel #END SECOND STAGE DEPENDENCIES Version: 2.34 Release: 0 -Url: https://www.kernel.org/pub/linux/utils/util-linux/ +URL: https://www.kernel.org/pub/linux/utils/util-linux/ Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.34/util-linux-%{version}.tar.xz Source1: util-linux-rpmlintrc Source2: util-linux-login_defs-check.sh @@ -147,6 +147,7 @@ Patch0: make-sure-sbin-resp-usr-sbin-are-in-PATH.diff Patch1: libmount-print-a-blacklist-hint-for-unknown-filesyst.patch Patch2: Add-documentation-on-blacklisted-modules-to-mount-8-.patch Patch3: libeconf.patch +Patch4: libmount-Avoid-triggering-autofs-in-lookup_umount_fs.patch Patch813: e3bb9bfb76c17b1d05814436ced62c05c4011f48.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # @@ -413,6 +414,7 @@ cp -a %{S:2} . %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %patch813 -p1 %build