Package: nfs-common
Version: 1:1.1.2-2
Severity: minor
When I invoke mount.nfs with the retry option, I'm surprised that the
retry duration will be the amount of time I gave *plus* the default
duration. This is not what is written in the nfs man page, quote:
'The number of minutes that the mount(8) command retries
an NFS mount operation [...] If this option is not specified, the
default value for foreground mounts is 2 minutes'.
But typing:
'date && mount.nfs server:/foo /mnt -o retry=2 -v' returns:
'Mon Apr 14 14:50:44 CEST 2008
mount.nfs: timeout set for Mon Apr 14 14:54:44 2008'
and not timeout set for 14:52:44...
When looking in the source file, it happens that default duration is
always added. Is this on purpose? If true, it should be specified in
the man page. If not, I attach a patch to take the command line values
when available.
Thanks,
Damien.
--- nfs-utils-1.1.2.orig/utils/mount/stropts.c
+++ nfs-utils-1.1.2/utils/mount/stropts.c
@@ -538,10 +538,11 @@
time_t timeout = time(NULL);
char *retry;
- timeout += 60 * 2; /* default: 2 minutes */
retry = po_get(options, "retry");
if (retry)
timeout += 60 * atoi(retry);
+ else
+ timeout += 60 * 2; /* default: 2 minutes */
if (verbose)
printf(_("%s: timeout set for %s"),
@@ -615,10 +616,11 @@
time_t timeout = time(NULL);
char *retry;
- timeout += 60 * 10000; /* default: 10,000 minutes */
retry = po_get(options, "retry");
if (retry)
timeout += 60 * atoi(retry);
+ else
+ timeout += 60 * 10000; /* default: 10,000 minutes */
for (;;) {
if (sleep(secs))