diff options
author | Flavio Leitner <flavio.leitner@gmail.com> | 2007-07-10 10:23:27 +1000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2007-07-10 10:23:27 +1000 |
commit | 2bb403d1547790e731e5b151f9ef41880a6eb6c7 (patch) | |
tree | bd7f3f8f7a576b4560ecd955304ad497703368bd /support/nfs/conn.c | |
parent | 1bcf67703e5606837853666763c739db91f08fee (diff) | |
download | nfs-utils-2bb403d1547790e731e5b151f9ef41880a6eb6c7.tar.gz nfs-utils-2bb403d1547790e731e5b151f9ef41880a6eb6c7.tar.xz nfs-utils-2bb403d1547790e731e5b151f9ef41880a6eb6c7.zip |
mount.nfs: Fix retry= to handle lack of reserved port situation
In the case of several (>500) mounts running at the same time
with -o tcp, the number of attempts that succeed is about 300-500
because it run out of priviledged port (they are busy in TIME_WAIT
state).
Signed-off-by: Flavio Leitner <flavio.leitner@gmail.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'support/nfs/conn.c')
-rw-r--r-- | support/nfs/conn.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/support/nfs/conn.c b/support/nfs/conn.c index 29dbb82..9b98682 100644 --- a/support/nfs/conn.c +++ b/support/nfs/conn.c @@ -200,6 +200,14 @@ CLIENT *mnt_openclnt(clnt_addr_t *mnt_server, int *msock) /* contact the mount daemon via TCP */ mnt_saddr->sin_port = htons((u_short)mnt_pmap->pm_port); *msock = get_socket(mnt_saddr, mnt_pmap->pm_prot, TRUE, FALSE); + if (*msock == RPC_ANYSOCK) { + if (rpc_createerr.cf_error.re_errno == EADDRINUSE) + /* Probably in-use by a TIME_WAIT connection, + * It is worth waiting a while and trying again. + */ + rpc_createerr.cf_stat = RPC_TIMEDOUT; + return NULL; + } switch (mnt_pmap->pm_prot) { case IPPROTO_UDP: |