]> Pileus Git - ~andy/linux/blobdiff - fs/logfs/gc.c
[LogFS] Split large truncated into smaller chunks
[~andy/linux] / fs / logfs / gc.c
index 92949f95a901079ec6a0c72464b09d588ce2b85d..e8253e7fb6b21dd224ad7a7fd2c3751da4447488 100644 (file)
@@ -458,6 +458,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;