linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mount.nfs: background mount now do directly into background
@ 2014-03-08 13:22 Steve Dickson
  2014-03-09 23:18 ` NeilBrown
  2014-03-11 21:13 ` Trond Myklebust
  0 siblings, 2 replies; 7+ messages in thread
From: Steve Dickson @ 2014-03-08 13:22 UTC (permalink / raw)
  To: Linux NFS Mailing list

Modern day kernel will no longer return all timeout
errors instead the process spins endlessly in the kernel.
This behavior will cause the foreground mount to hang, never
allowing the mount to go into background.

So this patch eliminates the foreground mount cause
background mounts to go directly into background

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 utils/mount/stropts.c |   31 ++++++++-----------------------
 1 files changed, 8 insertions(+), 23 deletions(-)

diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index a642394..92a7245 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -913,28 +913,6 @@ static int nfsmount_fg(struct nfsmount_info *mi)
 }
 
 /*
- * Handle "background" NFS mount [first try]
- *
- * Returns a valid mount command exit code.
- *
- * EX_BG should cause the caller to fork and invoke nfsmount_child.
- */
-static int nfsmount_parent(struct nfsmount_info *mi)
-{
-	if (nfs_try_mount(mi))
-		return EX_SUCCESS;
-
-	/* retry background mounts when the server is not up */
-	if (nfs_is_permanent_error(errno) && errno != EOPNOTSUPP) {
-		mount_error(mi->spec, mi->node, errno);
-		return EX_FAIL;
-	}
-
-	sys_mount_errors(mi->hostname, errno, 1, 1);
-	return EX_BG;
-}
-
-/*
  * Handle "background" NFS mount [retry daemon]
  *
  * Returns a valid mount command exit code: EX_SUCCESS if successful,
@@ -982,7 +960,14 @@ static int nfsmount_child(struct nfsmount_info *mi)
 static int nfsmount_bg(struct nfsmount_info *mi)
 {
 	if (!mi->child)
-		return nfsmount_parent(mi);
+		/* 
+		 * Modern day kernels no longer return all 
+		 * timeouts errors in all cases, instead 
+		 * the process spins in the kernel, which 
+		 * will hang a foreground mount. So background
+		 * mounts have to go directly into background
+		 */
+		return EX_BG;
 	else
 		return nfsmount_child(mi);
 }
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-03-11 23:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-08 13:22 [PATCH] mount.nfs: background mount now do directly into background Steve Dickson
2014-03-09 23:18 ` NeilBrown
2014-03-09 23:43   ` NeilBrown
2014-03-10 15:14     ` Steve Dickson
2014-03-11 21:13 ` Trond Myklebust
2014-03-11 22:56   ` Steve Dickson
2014-03-11 23:04     ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).