summaryrefslogtreecommitdiff
path: root/fs/bcachefs/error.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-02-01 23:45:45 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:50 +0300
commit2e98404000e9c48c235c234bd179bb1acbf4c4e2 (patch)
tree2c364795845e45583e187a632f88215ce81b0a0e /fs/bcachefs/error.c
parent464b415539cc543addb45b85e76c44da145b114c (diff)
downloadlinux-2e98404000e9c48c235c234bd179bb1acbf4c4e2.tar.xz
bcachefs: Improve btree node read error path
This ensures that failure to read a btree node error is treated as a topology error, and returns the correct error so that the topology repair pass will be run. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/error.c')
-rw-r--r--fs/bcachefs/error.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/bcachefs/error.c b/fs/bcachefs/error.c
index 3e49d72d65b5..c2882c599896 100644
--- a/fs/bcachefs/error.c
+++ b/fs/bcachefs/error.c
@@ -27,8 +27,11 @@ bool bch2_inconsistent_error(struct bch_fs *c)
void bch2_topology_error(struct bch_fs *c)
{
+ if (!test_bit(BCH_FS_TOPOLOGY_REPAIR_DONE, &c->flags))
+ return;
+
set_bit(BCH_FS_TOPOLOGY_ERROR, &c->flags);
- if (test_bit(BCH_FS_INITIAL_GC_DONE, &c->flags))
+ if (test_bit(BCH_FS_FSCK_DONE, &c->flags))
bch2_inconsistent_error(c);
}