From acb64a43e4503fbea9faf123f2403da7af8831eb Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Wed, 19 May 2010 17:00:10 +0100 Subject: jffs2: Require jffs2_garbage_collect_trigger() to be called with lock held We're about to call this from a bunch of places which already hold c->erase_completion_lock, so add an assertion and change its existing callers to do the same. Signed-off-by: David Woodhouse --- fs/jffs2/nodemgmt.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fs/jffs2/nodemgmt.c') diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c index 5ab5c8521cdf..dd2d920d3325 100644 --- a/fs/jffs2/nodemgmt.c +++ b/fs/jffs2/nodemgmt.c @@ -481,7 +481,9 @@ struct jffs2_raw_node_ref *jffs2_add_physical_node_ref(struct jffs2_sb_info *c, void jffs2_complete_reservation(struct jffs2_sb_info *c) { D1(printk(KERN_DEBUG "jffs2_complete_reservation()\n")); + spin_lock(&c->erase_completion_lock); jffs2_garbage_collect_trigger(c); + spin_unlock(&c->erase_completion_lock); mutex_unlock(&c->alloc_sem); } -- cgit v1.2.2