summaryrefslogtreecommitdiffstats
path: root/utils/mount/nfsmount.c
diff options
context:
space:
mode:
authorJeff Layton <jlaton@redhat.com>2008-05-07 10:27:53 -0400
committerSteve Dickson <steved@redhat.com>2008-05-07 10:27:53 -0400
commit5f7cc524008a7dc548a71f4c7b0d39759371a37a (patch)
treedee79a7ddffb4e03662a7c40e1f318b3795e0c7a /utils/mount/nfsmount.c
parentad1fc3feae447685a8ec8c7db0ad913fe3c4de5c (diff)
downloadnfs-utils-5f7cc524008a7dc548a71f4c7b0d39759371a37a.tar.gz
nfs-utils-5f7cc524008a7dc548a71f4c7b0d39759371a37a.tar.xz
nfs-utils-5f7cc524008a7dc548a71f4c7b0d39759371a37a.zip
Currently nfs4mount() sets the retry value to 10000 on both fg and bg
mounts. It should be 2 for fg and 10000 for bg. nfsmount() sets it properly, but there is a potential corner case. If someone explicitly sets retry=10000 on a fg mount, then it will be reset to 2. Fix this by having retry default to -1 for both flavors, and then reset if needed after the mount options have been parsed. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/nfsmount.c')
-rw-r--r--utils/mount/nfsmount.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/utils/mount/nfsmount.c b/utils/mount/nfsmount.c
index 6c0c365..a9dd917 100644
--- a/utils/mount/nfsmount.c
+++ b/utils/mount/nfsmount.c
@@ -571,7 +571,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 +585,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"),