diff options
author | Joern Engel <joern@logfs.org> | 2010-04-13 11:46:37 -0400 |
---|---|---|
committer | Joern Engel <joern@logfs.org> | 2010-04-13 11:46:37 -0400 |
commit | 032d8f7268444a0f5d4ee02d9513d682d5b8edfc (patch) | |
tree | 57cd841514abb9ffe7df7d2569513663f551f960 /fs/logfs/super.c | |
parent | e05c378f4973674a16d5b9636f2310cf88aca5f2 (diff) |
[LogFS] Prevent memory corruption on large deletes
Removing sufficiently large files would create aliases for a large
number of segments. This in turn results in a large number of journal
entries and an overflow of s_je_array.
Cheap fix is to add a BUG_ON, turning memory corruption into something
annoying, but less dangerous. Real fix is to count the number of
affected segments and prevent the problem completely.
Signed-off-by: Joern Engel <joern@logfs.org>
Diffstat (limited to 'fs/logfs/super.c')
-rw-r--r-- | fs/logfs/super.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/logfs/super.c b/fs/logfs/super.c index 9d856c49afc5..d6e1f4fc3115 100644 --- a/fs/logfs/super.c +++ b/fs/logfs/super.c | |||
@@ -451,6 +451,8 @@ static int logfs_read_sb(struct super_block *sb, int read_only) | |||
451 | 451 | ||
452 | btree_init_mempool64(&super->s_shadow_tree.new, super->s_btree_pool); | 452 | btree_init_mempool64(&super->s_shadow_tree.new, super->s_btree_pool); |
453 | btree_init_mempool64(&super->s_shadow_tree.old, super->s_btree_pool); | 453 | btree_init_mempool64(&super->s_shadow_tree.old, super->s_btree_pool); |
454 | btree_init_mempool32(&super->s_shadow_tree.segment_map, | ||
455 | super->s_btree_pool); | ||
454 | 456 | ||
455 | ret = logfs_init_mapping(sb); | 457 | ret = logfs_init_mapping(sb); |
456 | if (ret) | 458 | if (ret) |