aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJoern Engel <joern@logfs.org>2010-03-29 21:13:28 +0200
committerJoern Engel <joern@logfs.org>2010-03-29 21:13:28 +0200
commit0943846ae05603efd98550f2d475e9c98191bde8 (patch)
tree100452ab5f253b4137347669208bd1228a2f94d0 /fs
parent723b2ff40876678b49e61df34fb1d8001e34639d (diff)
[LogFS] Move reserved segments with journal
Fixes a GC livelock. Signed-off-by: Joern Engel <joern@logfs.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/logfs/journal.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/logfs/journal.c b/fs/logfs/journal.c
index 15454ac7bd93..25b1345c4652 100644
--- a/fs/logfs/journal.c
+++ b/fs/logfs/journal.c
@@ -800,6 +800,7 @@ void do_logfs_journal_wl_pass(struct super_block *sb)
{
struct logfs_super *super = logfs_super(sb);
struct logfs_area *area = super->s_journal_area;
+ struct btree_head32 *head = &super->s_reserved_segments;
u32 segno, ec;
int i, err;
@@ -807,6 +808,7 @@ void do_logfs_journal_wl_pass(struct super_block *sb)
/* Drop old segments */
journal_for_each(i)
if (super->s_journal_seg[i]) {
+ btree_remove32(head, super->s_journal_seg[i]);
logfs_set_segment_unreserved(sb,
super->s_journal_seg[i],
super->s_journal_ec[i]);
@@ -819,6 +821,8 @@ void do_logfs_journal_wl_pass(struct super_block *sb)
super->s_journal_seg[i] = segno;
super->s_journal_ec[i] = ec;
logfs_set_segment_reserved(sb, segno);
+ err = btree_insert32(head, segno, (void *)1, GFP_KERNEL);
+ BUG_ON(err); /* mempool should prevent this */
}
/* Manually move journal_area */
freeseg(sb, area->a_segno);