]> err.no Git - linux-2.6/blobdiff - fs/jffs2/gc.c
[JFFS2] Better fix for all-zero node headers
[linux-2.6] / fs / jffs2 / gc.c
index daff3341ff92b58cb72916678f69603e64ed5972..e92cf0f025290fa9d15729ba6ba05d8eceb38fa7 100644 (file)
@@ -144,7 +144,8 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
                               c->unchecked_size);
                        jffs2_dbg_dump_block_lists_nolock(c);
                        spin_unlock(&c->erase_completion_lock);
-                       BUG();
+                       up(&c->alloc_sem);
+                       return -ENOSPC;
                }
 
                spin_unlock(&c->erase_completion_lock);
@@ -838,6 +839,8 @@ static int jffs2_garbage_collect_deletion_dirent(struct jffs2_sb_info *c, struct
 
                for (raw = f->inocache->nodes; raw != (void *)f->inocache; raw = raw->next_in_ino) {
 
+                       cond_resched();
+
                        /* We only care about obsolete ones */
                        if (!(ref_obsolete(raw)))
                                continue;