The Samba-Bugzilla – Attachment 5455 Details for
Bug 7207
flush_cache must not touch uninitialized domains.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
v3-5-test
flush-cache-noinit-v3-5-test.mbox (text/plain), 3.34 KB, created by
Bo Yang
on 2010-03-03 23:15:46 UTC
(
hide
)
Description:
v3-5-test
Filename:
MIME Type:
Creator:
Bo Yang
Created:
2010-03-03 23:15:46 UTC
Size:
3.34 KB
patch
obsolete
>From c13b47311e85c214d484a727ccd972e9cfa367f4 Mon Sep 17 00:00:00 2001 >From: Bo Yang <boyang@samba.org> >Date: Tue, 9 Feb 2010 16:35:40 +0800 >Subject: [PATCH] s3: Don't invalidate cache for uninitialized domains. > >Signed-off-by: Bo Yang <boyang@samba.org> >(cherry picked from commit 9fed9011ffcd76c5a5dbf16f7d5e657b94f9fa50) >--- > source3/winbindd/winbindd.c | 25 ++++++++++++++++++++++++- > source3/winbindd/winbindd_cache.c | 27 +++++++++++++++++++++++++++ > source3/winbindd/winbindd_proto.h | 1 + > 3 files changed, 52 insertions(+), 1 deletions(-) > >diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c >index c0b42b8..e4c22a6 100644 >--- a/source3/winbindd/winbindd.c >+++ b/source3/winbindd/winbindd.c >@@ -141,6 +141,29 @@ static void flush_caches(void) > } > } > >+static void flush_caches_noinit(void) >+{ >+ /* >+ * We need to invalidate cached user list entries on a SIGHUP >+ * otherwise cached access denied errors due to restrict anonymous >+ * hang around until the sequence number changes. >+ * NB >+ * Skip uninitialized domains when flush cache. >+ * If domain is not initialized, it means it is never >+ * used or never become online. look, wcache_invalidate_cache() >+ * -> get_cache() -> init_dc_connection(). It causes a lot of traffic >+ * for unused domains and large traffic for primay domain's DC if there >+ * are many domains.. >+ */ >+ >+ if (!wcache_invalidate_cache_noinit()) { >+ DEBUG(0, ("invalidating the cache failed; revalidate the cache\n")); >+ if (!winbindd_cache_validate_and_initialize()) { >+ exit(1); >+ } >+ } >+} >+ > /* Handle the signal by unlinking socket and exiting */ > > static void terminate(bool is_parent) >@@ -254,7 +277,7 @@ static void winbindd_sig_hup_handler(struct tevent_context *ev, > const char *file = (const char *)private_data; > > DEBUG(1,("Reloading services after SIGHUP\n")); >- flush_caches(); >+ flush_caches_noinit(); > reload_services_file(file); > } > >diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c >index 81970d4..0d8ca70 100644 >--- a/source3/winbindd/winbindd_cache.c >+++ b/source3/winbindd/winbindd_cache.c >@@ -3024,6 +3024,33 @@ bool wcache_invalidate_cache(void) > return true; > } > >+bool wcache_invalidate_cache_noinit(void) >+{ >+ struct winbindd_domain *domain; >+ >+ for (domain = domain_list(); domain; domain = domain->next) { >+ struct winbind_cache *cache; >+ >+ /* Skip uninitialized domains. */ >+ if (!domain->initialized && !domain->internal) { >+ continue; >+ } >+ >+ cache = get_cache(domain); >+ >+ DEBUG(10, ("wcache_invalidate_cache: invalidating cache " >+ "entries for %s\n", domain->name)); >+ if (cache) { >+ if (cache->tdb) { >+ tdb_traverse(cache->tdb, traverse_fn, NULL); >+ } else { >+ return false; >+ } >+ } >+ } >+ return true; >+} >+ > bool init_wcache(void) > { > if (wcache == NULL) { >diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h >index 62fbc8e..94db131 100644 >--- a/source3/winbindd/winbindd_proto.h >+++ b/source3/winbindd/winbindd_proto.h >@@ -104,6 +104,7 @@ NTSTATUS wcache_save_creds(struct winbindd_domain *domain, > void wcache_invalidate_samlogon(struct winbindd_domain *domain, > struct netr_SamInfo3 *info3); > bool wcache_invalidate_cache(void); >+bool wcache_invalidate_cache_noinit(void); > bool init_wcache(void); > bool initialize_winbindd_cache(void); > void close_winbindd_cache(void); >-- >1.6.0.2 >
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
Flags:
jmcd
:
review+
Actions:
View
Attachments on
bug 7207
:
5454
| 5455