Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1:kernel-2.6.32
autofs
autofs-5.0.3-library-reload-fix.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File autofs-5.0.3-library-reload-fix.patch of Package autofs
autofs-5.0.3 - library reload fix From: Ian Kent <raven@themaw.net> During a map re-read autofs needs to re-open its lookup libraries but dependent shared libraries can't handle being unloaded and then re-loaded by the same process. This patch preventis dependent libraries from being unloaded during this re-open. --- CHANGELOG | 1 + daemon/automount.c | 1 - daemon/lookup.c | 21 +++++++++------------ daemon/state.c | 3 +++ include/master.h | 17 +++-------------- lib/master.c | 28 ++++++++++++++++++++++------ 6 files changed, 38 insertions(+), 33 deletions(-) Index: autofs-5.0.3/CHANGELOG =================================================================== --- autofs-5.0.3.orig/CHANGELOG 2009-01-08 14:27:48.000000000 +0100 +++ autofs-5.0.3/CHANGELOG 2009-01-08 14:28:36.000000000 +0100 @@ -96,6 +96,7 @@ - fix race during sub-mount shutdown. - fix add SEARCH_BASE configuration option. - update kernel patches. +- fix segv during library re-open. 18/06/2007 autofs-5.0.2 ----------------------- Index: autofs-5.0.3/daemon/automount.c =================================================================== --- autofs-5.0.3.orig/daemon/automount.c 2009-01-08 14:27:48.000000000 +0100 +++ autofs-5.0.3/daemon/automount.c 2009-01-08 14:28:04.000000000 +0100 @@ -85,7 +85,6 @@ int aquire_flag_file(void); void release_flag_file(void); static int umount_all(struct autofs_point *ap, int force); -extern pthread_mutex_t master_mutex; extern struct master *master_list; static int do_mkdir(const char *parent, const char *path, mode_t mode) Index: autofs-5.0.3/daemon/lookup.c =================================================================== --- autofs-5.0.3.orig/daemon/lookup.c 2009-01-08 14:27:48.000000000 +0100 +++ autofs-5.0.3/daemon/lookup.c 2009-01-08 14:28:04.000000000 +0100 @@ -267,17 +267,17 @@ static int do_read_map(struct autofs_poi struct lookup_mod *lookup; int status; - if (!map->lookup) { - lookup = open_lookup(map->type, "", - map->format, map->argc, map->argv); - if (!lookup) { - debug(ap->logopt, "lookup module %s failed", map->type); - return NSS_STATUS_UNAVAIL; - } - map->lookup = lookup; + lookup = open_lookup(map->type, "", map->format, map->argc, map->argv); + if (!lookup) { + debug(ap->logopt, "lookup module %s failed", map->type); + return NSS_STATUS_UNAVAIL; } - lookup = map->lookup; + master_source_writelock(ap->entry); + if (map->lookup) + close_lookup(map->lookup); + map->lookup = lookup; + master_source_unlock(ap->entry); /* If we don't need to create directories then there's no use * reading the map. We just need to test that the map is valid @@ -463,8 +463,6 @@ int lookup_nss_read_map(struct autofs_po * point in the master map) do the nss lookup to * locate the map and read it. */ - pthread_cleanup_push(master_source_lock_cleanup, entry); - master_source_readlock(entry); if (source) map = source; else @@ -557,7 +555,6 @@ int lookup_nss_read_map(struct autofs_po map = map->next; } - pthread_cleanup_pop(1); if (!result || at_least_one) return 1; Index: autofs-5.0.3/daemon/state.c =================================================================== --- autofs-5.0.3.orig/daemon/state.c 2009-01-08 14:27:48.000000000 +0100 +++ autofs-5.0.3/daemon/state.c 2009-01-08 14:28:04.000000000 +0100 @@ -387,9 +387,12 @@ static void *do_readmap(void *arg) info(ap->logopt, "re-reading map for %s", ap->path); + pthread_cleanup_push(master_mutex_lock_cleanup, NULL); + master_mutex_lock(); status = lookup_nss_read_map(ap, NULL, now); if (!status) pthread_exit(NULL); + pthread_cleanup_pop(1); if (ap->type == LKP_INDIRECT) { lookup_prune_cache(ap, now); Index: autofs-5.0.3/include/master.h =================================================================== --- autofs-5.0.3.orig/include/master.h 2009-01-08 14:27:48.000000000 +0100 +++ autofs-5.0.3/include/master.h 2009-01-08 14:28:04.000000000 +0100 @@ -70,6 +70,9 @@ int master_parse_entry(const char *, uns /* From master.c master parser utility routines */ +void master_mutex_lock(void); +void master_mutex_unlock(void); +void master_mutex_lock_cleanup(void *); void master_set_default_timeout(void); void master_set_default_ghost_mode(void); int master_add_autofs_point(struct master_mapent *, time_t, unsigned, unsigned, int); @@ -108,18 +111,4 @@ extern inline unsigned int master_get_lo int master_list_empty(struct master *); int master_kill(struct master *); -#define master_mutex_lock() \ -do { \ - int status = pthread_mutex_lock(&master_mutex); \ - if (status) \ - fatal(status); \ -} while (0) - -#define master_mutex_unlock() \ -do { \ - int status = pthread_mutex_unlock(&master_mutex); \ - if (status) \ - fatal(status); \ -} while (0) - #endif Index: autofs-5.0.3/lib/master.c =================================================================== --- autofs-5.0.3.orig/lib/master.c 2009-01-08 14:27:48.000000000 +0100 +++ autofs-5.0.3/lib/master.c 2009-01-08 14:28:04.000000000 +0100 @@ -41,8 +41,28 @@ static struct map_source * __master_find_map_source(struct master_mapent *, const char *, const char *, int, const char **); -pthread_mutex_t master_mutex = PTHREAD_MUTEX_INITIALIZER; -pthread_mutex_t instance_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t master_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t instance_mutex = PTHREAD_MUTEX_INITIALIZER; + +void master_mutex_lock(void) +{ + int status = pthread_mutex_lock(&master_mutex); + if (status) + fatal(status); +} + +void master_mutex_unlock(void) +{ + int status = pthread_mutex_unlock(&master_mutex); + if (status) + fatal(status); +} + +void master_mutex_lock_cleanup(void *arg) +{ + master_mutex_unlock(); + return; +} int master_add_autofs_point(struct master_mapent *entry, time_t timeout, unsigned logopt, unsigned ghost, int submount) @@ -1086,10 +1106,6 @@ int master_mount_mounts(struct master *m continue; } - master_source_writelock(ap->entry); - lookup_close_lookup(ap); - master_source_unlock(ap->entry); - cache_readlock(nc); ne = cache_lookup_distinct(nc, this->path); if (ne && this->age > ne->age) {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor