Merge branch 'bjorn-pci-root-v4-2.6.35' into release
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / logfs / gc.c
index 84e36f52fe9519a5481ca47e576d24f329a0c4d1..76c242fbe1b0a66c7d1b38c877beab55fb2995c4 100644 (file)
@@ -459,6 +459,14 @@ static void __logfs_gc_pass(struct super_block *sb, int target)
        struct logfs_block *block;
        int round, progress, last_progress = 0;
 
+       /*
+        * Doing too many changes to the segfile at once would result
+        * in a large number of aliases.  Write the journal before
+        * things get out of hand.
+        */
+       if (super->s_shadow_tree.no_shadowed_segments >= MAX_OBJ_ALIASES)
+               logfs_write_anchor(sb);
+
        if (no_free_segments(sb) >= target &&
                        super->s_no_object_aliases < MAX_OBJ_ALIASES)
                return;