aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoern Engel <joern@logfs.org>2010-03-29 15:13:28 -0400
committerJoern Engel <joern@logfs.org>2010-03-29 15:13:28 -0400
commit0943846ae05603efd98550f2d475e9c98191bde8 (patch)
tree100452ab5f253b4137347669208bd1228a2f94d0
parent723b2ff40876678b49e61df34fb1d8001e34639d (diff)
[LogFS] Move reserved segments with journal
Fixes a GC livelock. Signed-off-by: Joern Engel <joern@logfs.org>
-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)
800{ 800{
801 struct logfs_super *super = logfs_super(sb); 801 struct logfs_super *super = logfs_super(sb);
802 struct logfs_area *area = super->s_journal_area; 802 struct logfs_area *area = super->s_journal_area;
803 struct btree_head32 *head = &super->s_reserved_segments;
803 u32 segno, ec; 804 u32 segno, ec;
804 int i, err; 805 int i, err;
805 806
@@ -807,6 +808,7 @@ void do_logfs_journal_wl_pass(struct super_block *sb)
807 /* Drop old segments */ 808 /* Drop old segments */
808 journal_for_each(i) 809 journal_for_each(i)
809 if (super->s_journal_seg[i]) { 810 if (super->s_journal_seg[i]) {
811 btree_remove32(head, super->s_journal_seg[i]);
810 logfs_set_segment_unreserved(sb, 812 logfs_set_segment_unreserved(sb,
811 super->s_journal_seg[i], 813 super->s_journal_seg[i],
812 super->s_journal_ec[i]); 814 super->s_journal_ec[i]);
@@ -819,6 +821,8 @@ void do_logfs_journal_wl_pass(struct super_block *sb)
819 super->s_journal_seg[i] = segno; 821 super->s_journal_seg[i] = segno;
820 super->s_journal_ec[i] = ec; 822 super->s_journal_ec[i] = ec;
821 logfs_set_segment_reserved(sb, segno); 823 logfs_set_segment_reserved(sb, segno);
824 err = btree_insert32(head, segno, (void *)1, GFP_KERNEL);
825 BUG_ON(err); /* mempool should prevent this */
822 } 826 }
823 /* Manually move journal_area */ 827 /* Manually move journal_area */
824 freeseg(sb, area->a_segno); 828 freeseg(sb, area->a_segno);