Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93072
b: refs/heads/master
c: 422b120
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse committed Apr 23, 2008
1 parent 83008e3 commit 7d6dd2f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e2bc322bf05936ec7160d62bc3fd45cbf4aa405a
refs/heads/master: 422b120238130307da64fa44c9fb722bfaf5f1af
8 changes: 7 additions & 1 deletion trunk/fs/jffs2/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,13 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
jeb = jffs2_find_gc_block(c);

if (!jeb) {
D1 (printk(KERN_NOTICE "jffs2: Couldn't find erase block to garbage collect!\n"));
/* Couldn't find a free block. But maybe we can just erase one and make 'progress'? */
if (!list_empty(&c->erase_pending_list)) {
spin_unlock(&c->erase_completion_lock);
mutex_unlock(&c->alloc_sem);
return -EAGAIN;
}
D1(printk(KERN_NOTICE "jffs2: Couldn't find erase block to garbage collect!\n"));
spin_unlock(&c->erase_completion_lock);
mutex_unlock(&c->alloc_sem);
return -EIO;
Expand Down
5 changes: 4 additions & 1 deletion trunk/fs/jffs2/nodemgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize,
spin_unlock(&c->erase_completion_lock);

ret = jffs2_garbage_collect_pass(c);
if (ret)

if (ret == -EAGAIN)
jffs2_erase_pending_blocks(c, 1);
else if (ret)
return ret;

cond_resched();
Expand Down

0 comments on commit 7d6dd2f

Please sign in to comment.