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>
nocto = 0;
noac = 0;
unshared = 0;
- retry = 10000; /* 10000 minutes ~ 1 week */
+ retry = -1;
/*
* NFSv4 specifies that the default port should be 2049
}
}
+ /* if retry is still -1, then it wasn't set via an option */
+ if (retry == -1) {
+ if (bg)
+ retry = 10000; /* 10000 mins == ~1 week */
+ else
+ retry = 2; /* 2 min default on fg mounts */
+ }
+
data.flags = (soft ? NFS4_MOUNT_SOFT : 0)
| (intr ? NFS4_MOUNT_INTR : 0)
| (nocto ? NFS4_MOUNT_NOCTO : 0)
#endif
bg = 0;
- retry = 10000; /* 10000 minutes ~ 1 week */
+ retry = -1;
memset(mnt_pmap, 0, sizeof(*mnt_pmap));
mnt_pmap->pm_prog = MOUNTPROG;
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"),