Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68535
b: refs/heads/master
c: 2665ea8
h: refs/heads/master
i:
  68533: b4cf05e
  68531: e17c264
  68527: 4a41e5c
v: v3
  • Loading branch information
David Woodhouse committed Oct 13, 2007
1 parent e588518 commit 986b3ba
Show file tree
Hide file tree
Showing 2 changed files with 13 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: 85becc535b7f33be5aefdb8ecea9fac4998e4b6f
refs/heads/master: 2665ea842dc9f4c04bdb57f8b7c2023759ac8c85
14 changes: 12 additions & 2 deletions trunk/fs/jffs2/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
struct jffs2_inode_cache *ic;
struct jffs2_eraseblock *jeb;
struct jffs2_raw_node_ref *raw;
uint32_t gcblock_dirty;
int ret = 0, inum, nlink;
int xattr = 0;

Expand Down Expand Up @@ -236,6 +237,7 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
}

raw = jeb->gc_node;
gcblock_dirty = jeb->dirty_size;

while(ref_obsolete(raw)) {
D1(printk(KERN_DEBUG "Node at 0x%08x is obsolete... skipping\n", ref_offset(raw)));
Expand Down Expand Up @@ -282,7 +284,7 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
} else {
ret = jffs2_garbage_collect_xattr_ref(c, (struct jffs2_xattr_ref *)ic, raw);
}
goto release_sem;
goto test_gcnode;
}
#endif

Expand Down Expand Up @@ -376,7 +378,7 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)

if (ret != -EBADFD) {
spin_unlock(&c->inocache_lock);
goto release_sem;
goto test_gcnode;
}

/* Fall through if it wanted us to, with inocache_lock held */
Expand Down Expand Up @@ -407,6 +409,14 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)

jffs2_gc_release_inode(c, f);

test_gcnode:
if (jeb->dirty_size == gcblock_dirty && !ref_obsolete(jeb->gc_node)) {
/* Eep. This really should never happen. GC is broken */
printk(KERN_ERR "Error garbage collecting node at %08x!\n", ref_offset(jeb->gc_node));
ret = -ENOSPC;
} else if (ref_offset(jeb->gc_node) == 0x1c616bdc)
printk(KERN_ERR "Wheee. Correctly GC'd node at %08x\n", ref_offset(jeb->gc_node));

release_sem:
up(&c->alloc_sem);

Expand Down

0 comments on commit 986b3ba

Please sign in to comment.