Skip to content

Commit 74255aa

Browse files
author
Josef Bacik
committed
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 <[email protected]>
1 parent e75206c commit 74255aa

File tree

4 files changed

+540
-0
lines changed

4 files changed

+540
-0
lines changed

fs/btrfs/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,14 @@ config BTRFS_FS_CHECK_INTEGRITY
5252
In most cases, unless you are a btrfs developer who needs
5353
to verify the integrity of (super)-block write requests
5454
during the run of a regression test, say N
55+
56+
config BTRFS_FS_RUN_SANITY_TESTS
57+
bool "Btrfs will run sanity tests upon loading"
58+
depends on BTRFS_FS
59+
help
60+
This will run some basic sanity tests on the free space cache
61+
code to make sure it is acting as it should. These are mostly
62+
regression tests and are only really interesting to btrfs devlopers.
63+
64+
If unsure, say N.
65+

0 commit comments

Comments
 (0)