autofs/autofs-5.0.2-singleton-host-list.patch
Ian Kent 36ee8299b4 - fix schema selection in LDAP schema discovery.
- check for "*" when looking up wildcard in LDAP.
- fix couple of edge case parse fails of timeout option.
- add SEARCH_BASE configuration option.
- add random selection as a master map entry option.
- re-read config on HUP signal.
- add LDAP_URI, LDAP_TIMEOUT and LDAP_NETWORK_TIMEOUT configuration
    options.
- fix deadlock in submount mount module.
- fix lack of ferror() checking when reading files.
- fix typo in autofs(5) man page.
- fix map entry expansion when undefined macro is present.
- remove unused export validation code.
- add dynamic logging (adapted from v4 patch from Jeff Moyer).
- fix recursive loopback mounts (Matthias Koenig).
- add map re-load to verbose logging.
- fix handling of LDAP base dns with spaces.
- handle MTAB_NOTUPDATED status return from mount.
- when default master map, auto.master, is used also check for auto_master.
- update negative mount timeout handling.
- fix large group handling (Ryan Thomas).
- fix for dynamic logging breaking non-sasl build (Guillaume Rousse).
- eliminate NULL proc ping for singleton host or local mounts.
2007-11-20 07:34:21 +00:00

46 lines
1.2 KiB
Diff

diff --git a/modules/replicated.c b/modules/replicated.c
index 14b20a9..90b2925 100644
--- a/modules/replicated.c
+++ b/modules/replicated.c
@@ -725,19 +725,21 @@ int prune_host_list(unsigned logopt, struct host **list,
while (this && this->proximity == PROXIMITY_LOCAL)
this = this->next;
- proximity = PROXIMITY_LOCAL;
- if (this)
- proximity = this->proximity;
+ /*
+ * Check for either a list containing only proximity local hosts
+ * or a single host entry whose proximity isn't local. If so
+ * return immediately as we don't want to add probe latency for
+ * the common case of a single filesystem mount request.
+ */
+ if (!this || !this->next)
+ return 1;
+ proximity = this->proximity;
+ first = this;
this = first;
while (this) {
struct host *next = this->next;
- if (this->proximity == PROXIMITY_LOCAL) {
- this = next;
- continue;
- }
-
if (this->proximity != proximity)
break;
@@ -758,10 +760,6 @@ int prune_host_list(unsigned logopt, struct host **list,
last = this;
- /* If there are only local entries on the list, just return it. */
- if (!first)
- return 0;
-
/* Select NFS version of highest number of closest servers */
v4_tcp_count = v3_tcp_count = v2_tcp_count = 0;