From 71ac4d897b1d6ea7eb700db122c1111f35665cbfadf598c55a7449e116b04cc1 Mon Sep 17 00:00:00 2001 From: Petr Uzel Date: Fri, 28 May 2010 13:34:10 +0000 Subject: [PATCH 1/3] fix bnc#481123 OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=39 --- util-linux-mount-detect-ro-mount.patch | 41 ++++++++++++++++++++++++++ util-linux.changes | 5 ++++ util-linux.spec | 3 ++ 3 files changed, 49 insertions(+) create mode 100644 util-linux-mount-detect-ro-mount.patch diff --git a/util-linux-mount-detect-ro-mount.patch b/util-linux-mount-detect-ro-mount.patch new file mode 100644 index 0000000..313b2b3 --- /dev/null +++ b/util-linux-mount-detect-ro-mount.patch @@ -0,0 +1,41 @@ +From 81694f8c60dffb7851f941e69a1b79bc573ace53 Mon Sep 17 00:00:00 2001 +From: Petr Uzel +Date: Fri, 21 May 2010 15:19:31 +0200 +Subject: [PATCH] mount: detect when kernel silently adds MS_RDONLY flag + +Linux kernel can silently add MS_RDONLY flag when mounting file system that +does not have write support. Check this to avoid 'ro' in /proc/mounts and 'rw' +in mtab. + +[kzak@redhat.com: - don't check for 'ro' for MS_MOVE and MS_PROPAGATION] + +Reported-by: James Foris +Signed-off-by: Petr Uzel +Signed-off-by: Karel Zak +--- + mount/mount.c | 12 ++++++++++++ + 1 files changed, 12 insertions(+), 0 deletions(-) + +Index: util-linux-ng-2.17.2/mount/mount.c +=================================================================== +--- util-linux-ng-2.17.2.orig/mount/mount.c 2010-05-28 15:22:47.000000000 +0200 ++++ util-linux-ng-2.17.2/mount/mount.c 2010-05-28 15:23:03.000000000 +0200 +@@ -1388,6 +1388,18 @@ mount_retry: + flags &= ~MS_RDONLY; + } + ++ /* Kernel can silently add MS_RDONLY flag when mounting file system that ++ * does not have write support. Check this to avoid 'ro' in /proc/mounts ++ * and 'rw' in mtab. ++ */ ++ if (!fake && mnt5_res == 0 && ++ !(flags & MS_RDONLY) && !(flags & MS_PROPAGATION) && !(flags & MS_MOVE) && ++ is_readonly(node)) { ++ ++ printf(_("mount: warning: %s seems to be mounted read-only.\n"), node); ++ flags |= MS_RDONLY; ++ } ++ + if (fake || mnt5_res == 0) { + /* Mount succeeded, report this (if verbose) and write mtab entry. */ + diff --git a/util-linux.changes b/util-linux.changes index fb9e43f..6112efe 100644 --- a/util-linux.changes +++ b/util-linux.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri May 28 13:24:43 UTC 2010 - puzel@novell.com + +- add util-linux-mount-detect-ro-mount.patch (bnc#481123) + ------------------------------------------------------------------- Tue May 11 13:58:49 UTC 2010 - puzel@novell.com diff --git a/util-linux.spec b/util-linux.spec index 32676c3..9a626f8 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -73,6 +73,8 @@ Patch3: util-linux-2.17.1-mount_losetup_crypto.patch Patch4: util-linux-2.17.1-losetup-honor-documented-c-option # 603328 Patch5: util-linux-addpart-use-atoll.patch +# bnc#481123 +Patch6: util-linux-mount-detect-ro-mount.patch ## ## adjtimex ## @@ -162,6 +164,7 @@ unique IDs (UUIDs). %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 # cd adjtimex-* %patch50 -p1 From 1c05fa1ec4a45b8afe3c4075ca0e045bf2c5930874e4049d01de0f6cdb607efd Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Fri, 28 May 2010 14:54:12 +0000 Subject: [PATCH 2/3] checked in (request 40798) OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=40 --- util-linux-mount-detect-ro-mount.patch | 41 -------------------------- util-linux.changes | 5 ---- util-linux.spec | 3 -- 3 files changed, 49 deletions(-) delete mode 100644 util-linux-mount-detect-ro-mount.patch diff --git a/util-linux-mount-detect-ro-mount.patch b/util-linux-mount-detect-ro-mount.patch deleted file mode 100644 index 313b2b3..0000000 --- a/util-linux-mount-detect-ro-mount.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 81694f8c60dffb7851f941e69a1b79bc573ace53 Mon Sep 17 00:00:00 2001 -From: Petr Uzel -Date: Fri, 21 May 2010 15:19:31 +0200 -Subject: [PATCH] mount: detect when kernel silently adds MS_RDONLY flag - -Linux kernel can silently add MS_RDONLY flag when mounting file system that -does not have write support. Check this to avoid 'ro' in /proc/mounts and 'rw' -in mtab. - -[kzak@redhat.com: - don't check for 'ro' for MS_MOVE and MS_PROPAGATION] - -Reported-by: James Foris -Signed-off-by: Petr Uzel -Signed-off-by: Karel Zak ---- - mount/mount.c | 12 ++++++++++++ - 1 files changed, 12 insertions(+), 0 deletions(-) - -Index: util-linux-ng-2.17.2/mount/mount.c -=================================================================== ---- util-linux-ng-2.17.2.orig/mount/mount.c 2010-05-28 15:22:47.000000000 +0200 -+++ util-linux-ng-2.17.2/mount/mount.c 2010-05-28 15:23:03.000000000 +0200 -@@ -1388,6 +1388,18 @@ mount_retry: - flags &= ~MS_RDONLY; - } - -+ /* Kernel can silently add MS_RDONLY flag when mounting file system that -+ * does not have write support. Check this to avoid 'ro' in /proc/mounts -+ * and 'rw' in mtab. -+ */ -+ if (!fake && mnt5_res == 0 && -+ !(flags & MS_RDONLY) && !(flags & MS_PROPAGATION) && !(flags & MS_MOVE) && -+ is_readonly(node)) { -+ -+ printf(_("mount: warning: %s seems to be mounted read-only.\n"), node); -+ flags |= MS_RDONLY; -+ } -+ - if (fake || mnt5_res == 0) { - /* Mount succeeded, report this (if verbose) and write mtab entry. */ - diff --git a/util-linux.changes b/util-linux.changes index 6112efe..fb9e43f 100644 --- a/util-linux.changes +++ b/util-linux.changes @@ -1,8 +1,3 @@ -------------------------------------------------------------------- -Fri May 28 13:24:43 UTC 2010 - puzel@novell.com - -- add util-linux-mount-detect-ro-mount.patch (bnc#481123) - ------------------------------------------------------------------- Tue May 11 13:58:49 UTC 2010 - puzel@novell.com diff --git a/util-linux.spec b/util-linux.spec index 9a626f8..32676c3 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -73,8 +73,6 @@ Patch3: util-linux-2.17.1-mount_losetup_crypto.patch Patch4: util-linux-2.17.1-losetup-honor-documented-c-option # 603328 Patch5: util-linux-addpart-use-atoll.patch -# bnc#481123 -Patch6: util-linux-mount-detect-ro-mount.patch ## ## adjtimex ## @@ -164,7 +162,6 @@ unique IDs (UUIDs). %patch3 -p1 %patch4 -p1 %patch5 -p1 -%patch6 -p1 # cd adjtimex-* %patch50 -p1 From 9c4ef89952e69c764cab0363b4461eda90b282f9ec751379862cf30791a2d6b4 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Fri, 28 May 2010 14:54:13 +0000 Subject: [PATCH 3/3] Updating link to change in openSUSE:Factory/util-linux revision 91.0 OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=b7de1ab142cd13817916d75d37885f54 --- util-linux-mount-detect-ro-mount.patch | 41 ++++++++++++++++++++++++++ util-linux.changes | 5 ++++ util-linux.spec | 5 +++- 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 util-linux-mount-detect-ro-mount.patch diff --git a/util-linux-mount-detect-ro-mount.patch b/util-linux-mount-detect-ro-mount.patch new file mode 100644 index 0000000..313b2b3 --- /dev/null +++ b/util-linux-mount-detect-ro-mount.patch @@ -0,0 +1,41 @@ +From 81694f8c60dffb7851f941e69a1b79bc573ace53 Mon Sep 17 00:00:00 2001 +From: Petr Uzel +Date: Fri, 21 May 2010 15:19:31 +0200 +Subject: [PATCH] mount: detect when kernel silently adds MS_RDONLY flag + +Linux kernel can silently add MS_RDONLY flag when mounting file system that +does not have write support. Check this to avoid 'ro' in /proc/mounts and 'rw' +in mtab. + +[kzak@redhat.com: - don't check for 'ro' for MS_MOVE and MS_PROPAGATION] + +Reported-by: James Foris +Signed-off-by: Petr Uzel +Signed-off-by: Karel Zak +--- + mount/mount.c | 12 ++++++++++++ + 1 files changed, 12 insertions(+), 0 deletions(-) + +Index: util-linux-ng-2.17.2/mount/mount.c +=================================================================== +--- util-linux-ng-2.17.2.orig/mount/mount.c 2010-05-28 15:22:47.000000000 +0200 ++++ util-linux-ng-2.17.2/mount/mount.c 2010-05-28 15:23:03.000000000 +0200 +@@ -1388,6 +1388,18 @@ mount_retry: + flags &= ~MS_RDONLY; + } + ++ /* Kernel can silently add MS_RDONLY flag when mounting file system that ++ * does not have write support. Check this to avoid 'ro' in /proc/mounts ++ * and 'rw' in mtab. ++ */ ++ if (!fake && mnt5_res == 0 && ++ !(flags & MS_RDONLY) && !(flags & MS_PROPAGATION) && !(flags & MS_MOVE) && ++ is_readonly(node)) { ++ ++ printf(_("mount: warning: %s seems to be mounted read-only.\n"), node); ++ flags |= MS_RDONLY; ++ } ++ + if (fake || mnt5_res == 0) { + /* Mount succeeded, report this (if verbose) and write mtab entry. */ + diff --git a/util-linux.changes b/util-linux.changes index fb9e43f..6112efe 100644 --- a/util-linux.changes +++ b/util-linux.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri May 28 13:24:43 UTC 2010 - puzel@novell.com + +- add util-linux-mount-detect-ro-mount.patch (bnc#481123) + ------------------------------------------------------------------- Tue May 11 13:58:49 UTC 2010 - puzel@novell.com diff --git a/util-linux.spec b/util-linux.spec index 32676c3..e5ba049 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -27,7 +27,7 @@ License: GPLv2+ Group: System/Base AutoReqProv: on Version: 2.17.2 -Release: 2 +Release: 3 Recommends: %name-lang = %{version} Summary: A collection of basic system utilities Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v%{version}/%name-ng-%{version}.tar.bz2 @@ -73,6 +73,8 @@ Patch3: util-linux-2.17.1-mount_losetup_crypto.patch Patch4: util-linux-2.17.1-losetup-honor-documented-c-option # 603328 Patch5: util-linux-addpart-use-atoll.patch +# bnc#481123 +Patch6: util-linux-mount-detect-ro-mount.patch ## ## adjtimex ## @@ -162,6 +164,7 @@ unique IDs (UUIDs). %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 # cd adjtimex-* %patch50 -p1