Commit ad7e137e authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Switch reconstruct_alloc to a mount option

Right now this is the only way of repairing bucket gens in the future
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 05cf02b5
...@@ -285,9 +285,7 @@ do { \ ...@@ -285,9 +285,7 @@ do { \
"Force reads to use the reconstruct path, when reading" \ "Force reads to use the reconstruct path, when reading" \
"from erasure coded extents") \ "from erasure coded extents") \
BCH_DEBUG_PARAM(test_restart_gc, \ BCH_DEBUG_PARAM(test_restart_gc, \
"Test restarting mark and sweep gc when bucket gens change")\ "Test restarting mark and sweep gc when bucket gens change")
BCH_DEBUG_PARAM(test_reconstruct_alloc, \
"Test reconstructing the alloc btree")
#define BCH_DEBUG_PARAMS_ALL() BCH_DEBUG_PARAMS_ALWAYS() BCH_DEBUG_PARAMS_DEBUG() #define BCH_DEBUG_PARAMS_ALL() BCH_DEBUG_PARAMS_ALWAYS() BCH_DEBUG_PARAMS_DEBUG()
......
...@@ -258,6 +258,11 @@ enum opt_type { ...@@ -258,6 +258,11 @@ enum opt_type {
OPT_BOOL(), \ OPT_BOOL(), \
NO_SB_OPT, false, \ NO_SB_OPT, false, \
NULL, "Don\'t start filesystem, only open devices") \ NULL, "Don\'t start filesystem, only open devices") \
x(reconstruct_alloc, u8, \
OPT_MOUNT, \
OPT_BOOL(), \
NO_SB_OPT, false, \
NULL, "Reconstruct alloc btree") \
x(version_upgrade, u8, \ x(version_upgrade, u8, \
OPT_MOUNT, \ OPT_MOUNT, \
OPT_BOOL(), \ OPT_BOOL(), \
......
...@@ -659,7 +659,7 @@ static int read_btree_roots(struct bch_fs *c) ...@@ -659,7 +659,7 @@ static int read_btree_roots(struct bch_fs *c)
continue; continue;
if (i == BTREE_ID_ALLOC && if (i == BTREE_ID_ALLOC &&
test_reconstruct_alloc(c)) { c->opts.reconstruct_alloc) {
c->sb.compat &= ~(1ULL << BCH_COMPAT_FEAT_ALLOC_INFO); c->sb.compat &= ~(1ULL << BCH_COMPAT_FEAT_ALLOC_INFO);
continue; continue;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment