]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/jffs2/nodemgmt.c
jffs2: Require jffs2_garbage_collect_trigger() to be called with lock held
[net-next-2.6.git] / fs / jffs2 / nodemgmt.c
index 5ab5c8521cdf9576b308ba7237015438a82a9887..dd2d920d3325d2daabd76265f826542a2cdf1edd 100644 (file)
@@ -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);
 }