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 302658 Details for
Bug 333781
autofs can deadlock with multiple simulaneous access to a submount map
[?]
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.
[patch]
Create a separate startup conditional for each handle_mounts invocation
autofs-5.0.1-make-startup-cond-threadsafe.patch (text/plain), 8.78 KB, created by
Jeff Moyer
on 2008-04-16 19:41:30 UTC
(
hide
)
Description:
Create a separate startup conditional for each handle_mounts invocation
Filename:
MIME Type:
Creator:
Jeff Moyer
Created:
2008-04-16 19:41:30 UTC
Size:
8.78 KB
patch
obsolete
>Only in autofs-5.0.1: Makefile.conf >Only in autofs-5.0.1: config.log >Only in autofs-5.0.1: config.status >Only in autofs-5.0.1/daemon: automount >diff -upr --exclude=.version autofs-5.0.1.orig/daemon/automount.c autofs-5.0.1/daemon/automount.c >--- autofs-5.0.1.orig/daemon/automount.c 2008-04-16 15:09:20.000000000 -0400 >+++ autofs-5.0.1/daemon/automount.c 2008-04-16 15:32:50.000000000 -0400 >@@ -70,9 +70,6 @@ pthread_attr_t thread_attr; > struct master_readmap_cond mrc = { > PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, NULL, 0, 0, 0, 0}; > >-struct startup_cond suc = { >- PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0}; >- > pthread_key_t key_thread_stdenv_vars; > > #define MAX_OPEN_FILES 10240 >@@ -1473,15 +1470,17 @@ void *handle_mounts(void *arg) > { > struct autofs_point *ap; > int cancel_state, status = 0; >+ struct startup_cond *suc; > >- ap = (struct autofs_point *) arg; >+ suc = (struct startup_cond *) arg; >+ ap = suc->ap; > >- pthread_cleanup_push(return_start_status, &suc); >+ pthread_cleanup_push(return_start_status, suc); > pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cancel_state); > > state_mutex_lock(ap); > >- status = pthread_mutex_lock(&suc.mutex); >+ status = pthread_mutex_lock(&suc->mutex); > if (status) { > logerr("failed to lock startup condition mutex!"); > fatal(status); >@@ -1489,7 +1488,7 @@ void *handle_mounts(void *arg) > > if (mount_autofs(ap) < 0) { > crit(ap->logopt, "mount of %s failed!", ap->path); >- suc.status = 1; >+ suc->status = 1; > state_mutex_unlock(ap); > umount_autofs(ap, 1); > pthread_setcancelstate(cancel_state, NULL); >@@ -1499,7 +1498,7 @@ void *handle_mounts(void *arg) > if (ap->ghost && ap->type != LKP_DIRECT) > info(ap->logopt, "ghosting enabled"); > >- suc.status = 0; >+ suc->status = 0; > pthread_cleanup_pop(1); > > /* We often start several automounters at the same time. Add some >Only in autofs-5.0.1/daemon: automount.o >Only in autofs-5.0.1/daemon: direct.o >Only in autofs-5.0.1/daemon: indirect.o >Only in autofs-5.0.1/daemon: lookup.o >Only in autofs-5.0.1/daemon: module.o >Only in autofs-5.0.1/daemon: mount.o >Only in autofs-5.0.1/daemon: spawn.o >Only in autofs-5.0.1/daemon: state.o >Only in autofs-5.0.1: debugfiles.list >Only in autofs-5.0.1: debugsources.list >diff -upr --exclude=.version autofs-5.0.1.orig/include/automount.h autofs-5.0.1/include/automount.h >--- autofs-5.0.1.orig/include/automount.h 2008-04-16 15:09:20.000000000 -0400 >+++ autofs-5.0.1/include/automount.h 2008-04-16 15:32:50.000000000 -0400 >@@ -387,6 +387,7 @@ struct startup_cond { > pthread_cond_t cond; > unsigned int done; > unsigned int status; >+ struct autofs_point *ap; > }; > > struct master_readmap_cond { >@@ -520,6 +521,16 @@ do { \ > fatal(status); \ > } while(0) > >+static inline void >+initialize_startup_cond(struct startup_cond *suc, struct autofs_point *ap) >+{ >+ pthread_mutex_init(&suc->mutex, NULL); >+ pthread_cond_init(&suc->cond, NULL); >+ suc->status = 0; >+ suc->done = 0; >+ suc->ap = ap; >+} >+ > /* Expire alarm handling routines */ > int alarm_start_handler(void); > int alarm_add(struct autofs_point *ap, time_t seconds); >Only in autofs-5.0.1/include: config.h >Only in autofs-5.0.1/lib: alarm.o >Only in autofs-5.0.1/lib: args.o >Only in autofs-5.0.1/lib: autofs.a >Only in autofs-5.0.1/lib: cache.o >Only in autofs-5.0.1/lib: cat_path.o >Only in autofs-5.0.1/lib: defaults.o >Only in autofs-5.0.1/lib: log.o >Only in autofs-5.0.1/lib: macros.o >diff -upr --exclude=.version autofs-5.0.1.orig/lib/master.c autofs-5.0.1/lib/master.c >--- autofs-5.0.1.orig/lib/master.c 2008-04-16 15:09:20.000000000 -0400 >+++ autofs-5.0.1/lib/master.c 2008-04-16 15:35:44.000000000 -0400 >@@ -35,8 +35,6 @@ extern long global_negative_timeout; > /* Attribute to create detached thread */ > extern pthread_attr_t thread_attr; > >-extern struct startup_cond suc; >- > static struct map_source * > __master_find_map_source(struct master_mapent *, > const char *, const char *, int, const char **); >@@ -998,22 +996,20 @@ next: > > static int master_do_mount(struct master_mapent *entry) > { >- struct autofs_point *ap; >+ struct autofs_point *ap = entry->ap; > pthread_t thid; > int status; >+ struct startup_cond suc; >+ >+ initialize_startup_cond(&suc, ap); > > status = pthread_mutex_lock(&suc.mutex); > if (status) > fatal(status); > >- suc.done = 0; >- suc.status = 0; >- >- ap = entry->ap; >- > debug(ap->logopt, "mounting %s", entry->path); > >- if (pthread_create(&thid, &thread_attr, handle_mounts, ap)) { >+ if (pthread_create(&thid, &thread_attr, handle_mounts, &suc)) { > crit(ap->logopt, > "failed to create mount handler thread for %s", > entry->path); >Only in autofs-5.0.1/lib: master.o >Only in autofs-5.0.1/lib: master_parse.output >Only in autofs-5.0.1/lib: master_parse.tab.c >Only in autofs-5.0.1/lib: master_parse.tab.h >Only in autofs-5.0.1/lib: master_parse.tab.o >Only in autofs-5.0.1/lib: master_tok.c >Only in autofs-5.0.1/lib: master_tok.o >Only in autofs-5.0.1/lib: mount.h >Only in autofs-5.0.1/lib: mount_clnt.c >Only in autofs-5.0.1/lib: mount_clnt.o >Only in autofs-5.0.1/lib: mount_xdr.c >Only in autofs-5.0.1/lib: mount_xdr.o >Only in autofs-5.0.1/lib: mounts.o >Only in autofs-5.0.1/lib: nss_parse.output >Only in autofs-5.0.1/lib: nss_parse.tab.c >Only in autofs-5.0.1/lib: nss_parse.tab.h >Only in autofs-5.0.1/lib: nss_parse.tab.o >Only in autofs-5.0.1/lib: nss_tok.c >Only in autofs-5.0.1/lib: nss_tok.o >Only in autofs-5.0.1/lib: nsswitch.o >Only in autofs-5.0.1/lib: parse_subs.o >Only in autofs-5.0.1/lib: rpc_subs.o >Only in autofs-5.0.1/man: auto.master.5 >Only in autofs-5.0.1/man: autofs.8 >Only in autofs-5.0.1/man: automount.8 >Only in autofs-5.0.1/modules: cyrus-sasl.o >Only in autofs-5.0.1/modules: lookup_file.so >Only in autofs-5.0.1/modules: lookup_hesiod.so >Only in autofs-5.0.1/modules: lookup_hosts.so >Only in autofs-5.0.1/modules: lookup_ldap.so >Only in autofs-5.0.1/modules: lookup_multi.so >Only in autofs-5.0.1/modules: lookup_nisplus.so >Only in autofs-5.0.1/modules: lookup_program.so >Only in autofs-5.0.1/modules: lookup_userhome.so >Only in autofs-5.0.1/modules: lookup_yp.so >Only in autofs-5.0.1/modules: mount_afs.so >diff -upr --exclude=.version autofs-5.0.1.orig/modules/mount_autofs.c autofs-5.0.1/modules/mount_autofs.c >--- autofs-5.0.1.orig/modules/mount_autofs.c 2008-04-16 15:09:20.000000000 -0400 >+++ autofs-5.0.1/modules/mount_autofs.c 2008-04-16 15:35:51.000000000 -0400 >@@ -33,7 +33,6 @@ > > /* Attribute to create detached thread */ > extern pthread_attr_t thread_attr; >-extern struct startup_cond suc; > > int mount_version = AUTOFS_MOUNT_VERSION; /* Required by protocol */ > >@@ -60,6 +59,7 @@ int mount_mount(struct autofs_point *ap, > char buf[MAX_ERR_BUF]; > char *options, *p; > int ret; >+ struct startup_cond suc; > > fullpath = alloca(strlen(root) + name_len + 2); > if (!fullpath) { >@@ -216,6 +216,7 @@ int mount_mount(struct autofs_point *ap, > > mounts_mutex_lock(ap); > >+ initialize_startup_cond(&suc, nap); > status = pthread_mutex_lock(&suc.mutex); > if (status) { > crit(ap->logopt, >@@ -225,16 +226,13 @@ int mount_mount(struct autofs_point *ap, > return 1; > } > >- suc.done = 0; >- suc.status = 0; >- >- if (pthread_create(&thid, NULL, handle_mounts, nap)) { >+ if (pthread_create(&thid, NULL, handle_mounts, &suc)) { > crit(ap->logopt, > MODPREFIX > "failed to create mount handler thread for %s", > fullpath); >- mounts_mutex_unlock(ap); > status = pthread_mutex_unlock(&suc.mutex); >+ mounts_mutex_unlock(ap); > if (status) > fatal(status); > cache_release(source); >@@ -246,8 +244,8 @@ int mount_mount(struct autofs_point *ap, > while (!suc.done) { > status = pthread_cond_wait(&suc.cond, &suc.mutex); > if (status) { >- mounts_mutex_unlock(ap); > pthread_mutex_unlock(&suc.mutex); >+ mounts_mutex_unlock(ap); > fatal(status); > } > } >@@ -255,10 +253,10 @@ int mount_mount(struct autofs_point *ap, > if (suc.status) { > crit(ap->logopt, > MODPREFIX "failed to create submount for %s", fullpath); >- mounts_mutex_unlock(ap); > status = pthread_mutex_unlock(&suc.mutex); > if (status) > fatal(status); >+ mounts_mutex_unlock(ap); > master_free_mapent(entry); > return 1; > } >@@ -266,11 +264,10 @@ int mount_mount(struct autofs_point *ap, > ap->submnt_count++; > list_add(&nap->mounts, &ap->submounts); > >- mounts_mutex_unlock(ap); >- > status = pthread_mutex_unlock(&suc.mutex); > if (status) > fatal(status); >+ mounts_mutex_unlock(ap); > > return 0; > } >Only in autofs-5.0.1/modules: mount_autofs.so >Only in autofs-5.0.1/modules: mount_bind.so >Only in autofs-5.0.1/modules: mount_changer.so >Only in autofs-5.0.1/modules: mount_ext2.so >Only in autofs-5.0.1/modules: mount_generic.so >Only in autofs-5.0.1/modules: mount_nfs.so >Only in autofs-5.0.1/modules: parse_hesiod.so >Only in autofs-5.0.1/modules: parse_sun.so >Only in autofs-5.0.1/modules: replicated.o >Only in autofs-5.0.1/redhat: autofs.init >Only in autofs-5.0.1/redhat: autofs.sysconfig >Only in autofs-5.0.1/samples: autofs.conf.default >Only in autofs-5.0.1/samples: rc.autofs
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 333781
:
228481
| 302658