walters / rpms / nfs-utils

Forked from rpms/nfs-utils 6 years ago
Clone
85ed8ab
commit 5fb4042ce4eb4fd5e50e3fb0f78bbd20b4d46e78
85ed8ab
Author: Jeff Layton <jlaton@redhat.com>
85ed8ab
Date:   Wed May 7 10:37:40 2008 -0400
85ed8ab
85ed8ab
    The prev_bg_host stuff made sense when NFS didn't have its own mount
85ed8ab
    handler. Now though, each mount.nfs invocation is really a one-shot
85ed8ab
    affair, and this check no longer works. It also leaked memory. Remove
85ed8ab
    it.
85ed8ab
    
85ed8ab
    Signed-off-by: Jeff Layton <jlayton@redhat.com>
85ed8ab
    Signed-off-by: Steve Dickson <steved@redhat.com>
85ed8ab
85ed8ab
diff --git a/utils/mount/nfsmount.c b/utils/mount/nfsmount.c
85ed8ab
index a9dd917..6a04518 100644
85ed8ab
--- a/utils/mount/nfsmount.c
85ed8ab
+++ b/utils/mount/nfsmount.c
85ed8ab
@@ -494,7 +494,6 @@ int
85ed8ab
 nfsmount(const char *spec, const char *node, int flags,
85ed8ab
 	 char **extra_opts, int fake, int running_bg)
85ed8ab
 {
85ed8ab
-	static char *prev_bg_host;
85ed8ab
 	char hostdir[1024];
85ed8ab
 	char *hostname, *dirname, *old_opts, *mounthost = NULL;
85ed8ab
 	char new_opts[1024], cbuf[1024];
85ed8ab
@@ -628,18 +627,6 @@ nfsmount(const char *spec, const char *node, int flags,
85ed8ab
 	if (flags & MS_REMOUNT)
85ed8ab
 		goto out_ok;
85ed8ab
 
85ed8ab
-	/*
85ed8ab
-	 * If the previous mount operation on the same host was
85ed8ab
-	 * backgrounded, and the "bg" for this mount is also set,
85ed8ab
-	 * give up immediately, to avoid the initial timeout.
85ed8ab
-	 */
85ed8ab
-	if (bg && !running_bg &&
85ed8ab
-	    prev_bg_host && strcmp(hostname, prev_bg_host) == 0) {
85ed8ab
-		if (retry > 0)
85ed8ab
-			retval = EX_BG;
85ed8ab
-		return retval;
85ed8ab
-	}
85ed8ab
-
85ed8ab
 	/* create mount deamon client */
85ed8ab
 
85ed8ab
 	/*
85ed8ab
@@ -708,7 +695,6 @@ nfsmount(const char *spec, const char *node, int flags,
85ed8ab
 			continue;
85ed8ab
 		}
85ed8ab
 		if (!running_bg) {
85ed8ab
-			prev_bg_host = xstrdup(hostname);
85ed8ab
 			if (retry > 0)
85ed8ab
 				retval = EX_BG;
85ed8ab
 			goto fail;