aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-03-15 09:47:08 -0400
committerJosef Bacik <jbacik@fusionio.com>2013-05-06 15:52:54 -0400
commit74255aa07d292385ca3a4a4e8f0bc492d9bdd116 (patch)
tree02ee09448bbb988baf59bed8615a9f0dcc608a5a /fs/btrfs/super.c
parente75206cfdc89f4b5361776443acba4c940770b30 (diff)
Btrfs: add some free space cache tests
We keep hitting bugs in the tree log replay because btrfs_remove_free_space doesn't account for some corner case. So add a bunch of tests to try and fully test btrfs_remove_free_space since the only time it is called is during tree log replay. These tests all finish successfully, so as we find more of these bugs we need to add to these tests to make sure we don't regress in fixing things. I've hidden the tests behind a Kconfig option, but they take no time to run so all btrfs developers should have this turned on all the time. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index f6b88595f858..714ae479de2e 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -56,6 +56,7 @@
56#include "compression.h" 56#include "compression.h"
57#include "rcu-string.h" 57#include "rcu-string.h"
58#include "dev-replace.h" 58#include "dev-replace.h"
59#include "free-space-cache.h"
59 60
60#define CREATE_TRACE_POINTS 61#define CREATE_TRACE_POINTS
61#include <trace/events/btrfs.h> 62#include <trace/events/btrfs.h>
@@ -1739,6 +1740,10 @@ static int __init init_btrfs_fs(void)
1739 1740
1740 btrfs_init_lockdep(); 1741 btrfs_init_lockdep();
1741 1742
1743#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
1744 btrfs_test_free_space_cache();
1745#endif
1746
1742 printk(KERN_INFO "%s loaded\n", BTRFS_BUILD_VERSION); 1747 printk(KERN_INFO "%s loaded\n", BTRFS_BUILD_VERSION);
1743 return 0; 1748 return 0;
1744 1749