Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 186291 Details for
Bug 223083
autofs failed to mount using wildkey and replicated configuration
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Keep the random selection from overflowing
autofs-4.1.3-scale-random-elapsed-time.patch (text/x-patch), 3.81 KB, created by
Jeff Moyer
on 2007-09-04 17:01:41 UTC
(
hide
)
Description:
Keep the random selection from overflowing
Filename:
MIME Type:
Creator:
Jeff Moyer
Created:
2007-09-04 17:01:41 UTC
Size:
3.81 KB
patch
obsolete
>--- autofs-4.1.3/modules/replicated.c.scale-random 2007-09-04 10:46:33.000000000 -0400 >+++ autofs-4.1.3/modules/replicated.c 2007-09-04 12:43:13.000000000 -0400 >@@ -370,6 +370,32 @@ static unsigned short get_port_option(co > return (unsigned short) port; > } > >+/* >+ * This function calculates the amount of time it takes to perform >+ * an rpc ping of a server for a given version and protocol of NFS. >+ * The elapsed time is stored in the rpc_time parameter. The result >+ * is only valid if the function returns succes (1). >+ */ >+static int time_rpc_ping_proto(struct conn_info *rpc_info, double *rpc_time) >+{ >+ struct timeval start, end; >+ struct timezone tz; >+ int status; >+ >+ if (ap.random_multimount) { >+ *rpc_time = random() / (double)RAND_MAX; >+ } else { >+ gettimeofday(&start, &tz); >+ status = rpc_ping_proto(rpc_info); >+ gettimeofday(&end, &tz); >+ if (!status) >+ return 0; >+ *rpc_time = elapsed(start, end); >+ } >+ >+ return 1; >+} >+ > static unsigned int get_nfs_info(struct host *host, > struct conn_info *pm_info, struct conn_info *rpc_info, > const char *proto, unsigned int version, >@@ -377,11 +403,10 @@ static unsigned int get_nfs_info(struct > { > char *have_port_opt = options ? strstr(options, "port=") : NULL; > struct pmap parms; >- struct timeval start, end; >- struct timezone tz; > unsigned int supported = 0; > double taken = 0; > int status, count = 0; >+ double rpc_time; > > memset(&parms, 0, sizeof(struct pmap)); > >@@ -403,19 +428,10 @@ static unsigned int get_nfs_info(struct > else > status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS4_VERSION); > if (status) { >- if (ap.random_multimount) { >- taken += random(); >+ if (time_rpc_ping_proto(rpc_info, &rpc_time)) { >+ taken += rpc_time; > count++; > supported = NFS4_SUPPORTED; >- } else { >- gettimeofday(&start, &tz); >- status = rpc_ping_proto(rpc_info); >- gettimeofday(&end, &tz); >- if (status) { >- taken += elapsed(start, end); >- count++; >- supported = NFS4_SUPPORTED; >- } > } > } > >@@ -446,19 +462,10 @@ v3_ver: > else > status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS3_VERSION); > if (status) { >- if (ap.random_multimount) { >- taken += random(); >+ if (time_rpc_ping_proto(rpc_info, &rpc_time)) { >+ taken += rpc_time; > count++; > supported |= NFS3_SUPPORTED; >- } else { >- gettimeofday(&start, &tz); >- status = rpc_ping_proto(rpc_info); >- gettimeofday(&end, &tz); >- if (status) { >- taken += elapsed(start, end); >- count++; >- supported |= NFS3_SUPPORTED; >- } > } > } > >@@ -482,19 +489,10 @@ v2_ver: > else > status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS2_VERSION); > if (status) { >- if (ap.random_multimount) { >- taken += random(); >+ if (time_rpc_ping_proto(rpc_info, &rpc_time)) { >+ taken += rpc_time; > count++; > supported |= NFS2_SUPPORTED; >- } else { >- gettimeofday(&start, &tz); >- status = rpc_ping_proto(rpc_info); >- gettimeofday(&end, &tz); >- if (status) { >- taken += elapsed(start, end); >- count++; >- supported |= NFS2_SUPPORTED; >- } > } > } > >@@ -571,8 +569,6 @@ static int get_supported_ver_and_cost(st > struct pmap parms; > const char *proto; > unsigned int vers; >- struct timeval start, end; >- struct timezone tz; > double taken = 0; > time_t timeout = RPC_TIMEOUT; > int status; >@@ -654,17 +650,9 @@ static int get_supported_ver_and_cost(st > status = rpc_udp_getclient(&rpc_info, NFS_PROGRAM, parms.pm_vers); > else > status = rpc_tcp_getclient(&rpc_info, NFS_PROGRAM, parms.pm_vers); >- if (status) { >- if (ap.random_multimount) >- taken = random(); >- else { >- gettimeofday(&start, &tz); >- status = rpc_ping_proto(&rpc_info); >- gettimeofday(&end, &tz); >- if (status) >- taken = elapsed(start, end); >- } >- } >+ if (status) >+ status = time_rpc_ping_proto(&rpc_info, &taken); >+ > done: > if (rpc_info.proto->p_proto == IPPROTO_UDP) { > rpc_destroy_udp_client(&rpc_info);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 223083
:
146224
|
146253
|
146325
| 186291