diff options
author | NeilBrown <neilb@suse.com> | 2016-03-16 11:01:18 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2016-03-16 12:21:55 -0400 |
commit | 3904d8102cbc76b26feccd573cb475fbf346c977 (patch) | |
tree | 35584d5bf72b0e29d9e84775d1e5e975ef1dd2a8 | |
parent | 1412314d3d4f096144f5293724f5c894dbfabb06 (diff) | |
download | nfs-utils-3904d8102cbc76b26feccd573cb475fbf346c977.tar.gz nfs-utils-3904d8102cbc76b26feccd573cb475fbf346c977.tar.xz nfs-utils-3904d8102cbc76b26feccd573cb475fbf346c977.zip |
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 requested 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 removes the confusing "already mounted" errors.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | utils/mount/stropts.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index 86829a9..320dde2 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; |