From c1b592fec3a47e4e893c273cdd2126f644ef8ef87ab3f70bac61f6a7d917a75f Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 2 Mar 2016 03:54:52 +0000 Subject: [PATCH] - 0001-mount.nfs-hide-EBUSY-errors.patch Stop "mount -a -t nfs" from complaining if filesystem already mounted (bsc#950340) OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=157 --- 0001-mount.nfs-hide-EBUSY-errors.patch | 48 ++++++++++++++++++++++++++ nfs-utils.changes | 7 ++++ nfs-utils.spec | 2 ++ 3 files changed, 57 insertions(+) create mode 100644 0001-mount.nfs-hide-EBUSY-errors.patch diff --git a/0001-mount.nfs-hide-EBUSY-errors.patch b/0001-mount.nfs-hide-EBUSY-errors.patch new file mode 100644 index 0000000..71193c2 --- /dev/null +++ b/0001-mount.nfs-hide-EBUSY-errors.patch @@ -0,0 +1,48 @@ +From f0dc907b52892c18ccad2e573850583c0ee01157 Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Wed, 21 Oct 2015 14:07:52 +1100 +Subject: [PATCH] mount.nfs - hide EBUSY errors. + +Linux only returns EBUSY for a non-remount mount if the exact +requested filesystem is already mounted. Arguably this is not an +error. + +"mount -a" tries to see if each request filesystem is already mounted. +Sometimes it gets it wrong - e.g. hostname aliases can confuse it. +So "mount -a" will report a failure "already mounted", which is +wrong because it should filter those out. + +An easy fix it just to be silent about EBUSY. As the requested +result (a given filesystem being mounted at a given location) is in +effect after the EBUSY return, we can just treat it as success. + +This removed the confusing "already mounted" errors. + +Signed-off-by: NeilBrown +--- + utils/mount/stropts.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c +index 86829a902bfd..320dde2fab92 100644 +--- a/utils/mount/stropts.c ++++ b/utils/mount/stropts.c +@@ -960,6 +960,15 @@ static int nfsmount_fg(struct nfsmount_info *mi) + if (nfs_try_mount(mi)) + return EX_SUCCESS; + ++ if (errno == EBUSY) ++ /* The only cause of EBUSY is if exactly the desired ++ * filesystem is already mounted. That can arguably ++ * be seen as success. "mount -a" tries to optimise ++ * out this case but sometimes fails. Help it out ++ * by pretending everything is rosy ++ */ ++ return EX_SUCCESS; ++ + if (nfs_is_permanent_error(errno)) + break; + +-- +2.7.2 + diff --git a/nfs-utils.changes b/nfs-utils.changes index df778c0..6600eff 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Mar 2 03:53:26 UTC 2016 - neilb@suse.com + +- 0001-mount.nfs-hide-EBUSY-errors.patch + Stop "mount -a -t nfs" from complaining if filesystem + already mounted (bsc#950340) + ------------------------------------------------------------------- Thu Feb 18 06:04:05 UTC 2016 - neilb@suse.com diff --git a/nfs-utils.spec b/nfs-utils.spec index 91f6400..fdb0702 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -64,6 +64,7 @@ Patch0: nfs-utils-1.0.7-bind-syntax.patch Patch1: nfs-utils-no-svcgss.service Patch2: nfs-utils-uninit-mem.patch Patch3: 0001-Fix-protocol-minor-version-fall-back.patch +Patch4: 0001-mount.nfs-hide-EBUSY-errors.patch Suggests: python-base %description @@ -117,6 +118,7 @@ This package contains additional NFS documentation. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 cp %{S:6} . %build