mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 16:37:50 +00:00
bcachefs: More debug params for testing of recovery paths
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
05235e9928
commit
6122ab639c
3 changed files with 12 additions and 2 deletions
|
@ -278,7 +278,11 @@ do { \
|
||||||
"cached data") \
|
"cached data") \
|
||||||
BCH_DEBUG_PARAM(force_reconstruct_read, \
|
BCH_DEBUG_PARAM(force_reconstruct_read, \
|
||||||
"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, \
|
||||||
|
"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()
|
||||||
|
|
||||||
|
|
|
@ -750,7 +750,9 @@ int bch2_gc(struct bch_fs *c, struct list_head *journal, bool initial)
|
||||||
|
|
||||||
c->gc_count++;
|
c->gc_count++;
|
||||||
out:
|
out:
|
||||||
if (!ret && test_bit(BCH_FS_FIXED_GENS, &c->flags)) {
|
if (!ret &&
|
||||||
|
(test_bit(BCH_FS_FIXED_GENS, &c->flags) ||
|
||||||
|
(!iter && test_restart_gc(c)))) {
|
||||||
/*
|
/*
|
||||||
* XXX: make sure gens we fixed got saved
|
* XXX: make sure gens we fixed got saved
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -277,6 +277,10 @@ int bch2_fs_recovery(struct bch_fs *c)
|
||||||
if (r->error)
|
if (r->error)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
if (i == BTREE_ID_ALLOC &&
|
||||||
|
test_reconstruct_alloc(c))
|
||||||
|
continue;
|
||||||
|
|
||||||
err = "error reading btree root";
|
err = "error reading btree root";
|
||||||
ret = bch2_btree_root_read(c, i, &r->key, r->level);
|
ret = bch2_btree_root_read(c, i, &r->key, r->level);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|
Loading…
Reference in a new issue