X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmount%2Fnfs4mount.c;h=af70551f595e696a01a2a9bfbe98a53a1f87736d;hp=c4e8bfb0a3ba7d1a04339604d8e6db55fbeb13a7;hb=5f7cc524008a7dc548a71f4c7b0d39759371a37a;hpb=7a92dbf8cc01ed3b32c124d8f23348a39b992b54 diff --git a/utils/mount/nfs4mount.c b/utils/mount/nfs4mount.c index c4e8bfb..af70551 100644 --- a/utils/mount/nfs4mount.c +++ b/utils/mount/nfs4mount.c @@ -18,6 +18,10 @@ * - Moved to nfs-utils/utils/mount from util-linux/mount. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -234,7 +238,7 @@ int nfs4mount(const char *spec, const char *node, int flags, nocto = 0; noac = 0; unshared = 0; - retry = 10000; /* 10000 minutes ~ 1 week */ + retry = -1; /* * NFSv4 specifies that the default port should be 2049 @@ -328,6 +332,14 @@ int nfs4mount(const char *spec, const char *node, int flags, } } + /* 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) @@ -428,15 +440,15 @@ int nfs4mount(const char *spec, const char *node, int flags, if (errno == ETIMEDOUT) break; default: - mount_errors(hostname, 0, bg); + rpc_mount_errors(hostname, 0, bg); goto fail; } t = time(NULL); if (t >= timeout) { - mount_errors(hostname, 0, bg); + rpc_mount_errors(hostname, 0, bg); goto fail; } - mount_errors(hostname, 1, bg); + rpc_mount_errors(hostname, 1, bg); continue; } @@ -448,7 +460,7 @@ int nfs4mount(const char *spec, const char *node, int flags, } } - return 0; + return EX_SUCCESS; fail: return retval;