summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2013-03-19 17:33:46 +0100
committerMiklos Szeredi <mszeredi@suse.cz>2013-03-19 17:33:46 +0100
commit4dec04c7edba86d45371059c6c99016f08762fec (patch)
tree49873639256c59e76b4e23aa64e376b14796b9cb
parent4e602d6f0c1cd71bcba77f8e6ddcc7e6034f4d2d (diff)
parent44088bc7fbe7c9234c090756dbf10742b1a281b1 (diff)
downloadfuse-4dec04c7edba86d45371059c6c99016f08762fec.tar.gz
Merge branch 'fuse_2_9_bugfix'
-rw-r--r--ChangeLog6
-rw-r--r--lib/fuse.c1
-rw-r--r--lib/fuse_loop_mt.c2
3 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2021e81..a543264 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-03-19 Miklos Szeredi <miklos@szeredi.hu>
+
+ * libfuse: fix thread cancel race. Exiting a worker my race with
+ cancelling that same worker. This caused a segmenation
+ fault. Reported and tested by Anatol Pomozov
+
2013-02-20 Miklos Szeredi <miklos@szeredi.hu>
* libfuse: change the type of fuse_ino_t from 'unsigned long' to
diff --git a/lib/fuse.c b/lib/fuse.c
index adc1e64..e2d48d3 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -4180,6 +4180,7 @@ static void fuse_lib_help(void)
" -o ac_attr_timeout=T auto cache timeout for attributes (attr_timeout)\n"
" -o noforget never forget cached inodes\n"
" -o remember=T remember cached inodes for T seconds (0s)\n"
+" -o nopath don't supply path if not necessary\n"
" -o intr allow requests to be interrupted\n"
" -o intr_signal=NUM signal to send on interrupt (%i)\n"
" -o modules=M1[:M2...] names of modules to push onto filesystem stack\n"
diff --git a/lib/fuse_loop_mt.c b/lib/fuse_loop_mt.c
index 7ae5890..82e3001 100644
--- a/lib/fuse_loop_mt.c
+++ b/lib/fuse_loop_mt.c
@@ -241,9 +241,11 @@ int fuse_session_loop_mt(struct fuse_session *se)
while (!fuse_session_exited(se))
sem_wait(&mt.finish);
+ pthread_mutex_lock(&mt.lock);
for (w = mt.main.next; w != &mt.main; w = w->next)
pthread_cancel(w->thread_id);
mt.exit = 1;
+ pthread_mutex_unlock(&mt.lock);
while (mt.main.next != &mt.main)
fuse_join_worker(&mt, mt.main.next);