[gvfs] Fix deadlock in MetaTree
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Subject: [gvfs] Fix deadlock in MetaTree
- Date: Tue, 23 Jun 2009 15:12:19 -0400 (EDT)
commit 5fb558770f0a3f3c7d277855700e6812c01a9762
Author: Alexander Larsson <alexl redhat com>
Date: Tue Jun 23 20:52:34 2009 +0200
Fix deadlock in MetaTree
meta_tree_refresh calls meta_tree_init which may call
meta_tree_refresh, which can deadlock due to the writer lock. Call
meta_tree_refresh_locked instead.
metadata/metatree.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/metadata/metatree.c b/metadata/metatree.c
index 9664fa8..0f66893 100644
--- a/metadata/metatree.c
+++ b/metadata/metatree.c
@@ -170,6 +170,7 @@ struct _MetaTree {
MetaJournal *journal;
};
+static void meta_tree_refresh_locked (MetaTree *tree);
static MetaJournal *meta_journal_open (MetaTree *tree,
const char *filename,
gboolean for_write,
@@ -504,7 +505,7 @@ meta_tree_init (MetaTree *tree)
journal. However we can detect this case by looking at the tree and see
if its been rotated, we do this to ensure we have an uptodate tree+journal
combo. */
- meta_tree_refresh (tree);
+ meta_tree_refresh_locked (tree);
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]