X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fmount%2Fnfsmount.c;h=6a045184d55648f7ec156d8b994f1fa97470338b;hb=5fb4042ce4eb4fd5e50e3fb0f78bbd20b4d46e78;hp=6c0c3655b5c23768825c812fc99b13cf043712ec;hpb=7d9dcf303b30aeb8b3dc06616d42a8abbdc61b27;p=nfs-utils.git diff --git a/utils/mount/nfsmount.c b/utils/mount/nfsmount.c index 6c0c365..6a04518 100644 --- a/utils/mount/nfsmount.c +++ b/utils/mount/nfsmount.c @@ -494,7 +494,6 @@ int nfsmount(const char *spec, const char *node, int flags, char **extra_opts, int fake, int running_bg) { - static char *prev_bg_host; char hostdir[1024]; char *hostname, *dirname, *old_opts, *mounthost = NULL; char new_opts[1024], cbuf[1024]; @@ -571,7 +570,7 @@ nfsmount(const char *spec, const char *node, int flags, #endif bg = 0; - retry = 10000; /* 10000 minutes ~ 1 week */ + retry = -1; memset(mnt_pmap, 0, sizeof(*mnt_pmap)); mnt_pmap->pm_prog = MOUNTPROG; @@ -585,9 +584,13 @@ nfsmount(const char *spec, const char *node, int flags, goto fail; if (!nfsmnt_check_compat(nfs_pmap, mnt_pmap)) goto fail; - - if (retry == 10000 && !bg) - retry = 2; /* reset for fg mounts */ + + if (retry == -1) { + if (bg) + retry = 10000; /* 10000 mins == ~1 week*/ + else + retry = 2; /* 2 min default on fg mounts */ + } #ifdef NFS_MOUNT_DEBUG printf(_("rsize = %d, wsize = %d, timeo = %d, retrans = %d\n"), @@ -624,18 +627,6 @@ nfsmount(const char *spec, const char *node, int flags, if (flags & MS_REMOUNT) goto out_ok; - /* - * If the previous mount operation on the same host was - * backgrounded, and the "bg" for this mount is also set, - * give up immediately, to avoid the initial timeout. - */ - if (bg && !running_bg && - prev_bg_host && strcmp(hostname, prev_bg_host) == 0) { - if (retry > 0) - retval = EX_BG; - return retval; - } - /* create mount deamon client */ /* @@ -704,7 +695,6 @@ nfsmount(const char *spec, const char *node, int flags, continue; } if (!running_bg) { - prev_bg_host = xstrdup(hostname); if (retry > 0) retval = EX_BG; goto fail;