summaryrefslogtreecommitdiff
path: root/fs/bcachefs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-04-29 22:32:44 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:02 -0400
commitd99af4f194d7af8aa11233707826875ef0704034 (patch)
tree2587558fa7dcbbad7b6a62008d884c218f64d5a0 /fs/bcachefs
parent3dea728ce64bdd3c8c5e98cb7b8a148d52c8f0d4 (diff)
bcachefs: Call bch2_inconsistent_error() on missing stripe/indirect extent
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r--fs/bcachefs/buckets.c4
-rw-r--r--fs/bcachefs/io.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index e6e984587b5d..d6f0325affcc 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -902,6 +902,7 @@ static int bch2_mark_stripe_ptr(struct bch_fs *c,
spin_unlock(&c->ec_stripes_heap_lock);
bch_err_ratelimited(c, "pointer to nonexistent stripe %llu",
(u64) p.idx);
+ bch2_inconsistent_error(c);
return -EIO;
}
@@ -1019,6 +1020,7 @@ static int bch2_mark_stripe(struct bch_fs *c,
if (!m || (old_s && !m->alive)) {
bch_err_ratelimited(c, "error marking nonexistent stripe %zu",
idx);
+ bch2_inconsistent_error(c);
return -1;
}
@@ -1503,6 +1505,7 @@ static int bch2_trans_mark_stripe_ptr(struct btree_trans *trans,
bch2_fs_inconsistent(c,
"pointer to nonexistent stripe %llu",
(u64) p.ec.idx);
+ bch2_inconsistent_error(c);
ret = -EIO;
goto out;
}
@@ -1743,6 +1746,7 @@ static int __bch2_trans_mark_reflink_p(struct btree_trans *trans,
bch2_fs_inconsistent(c,
"%llu:%llu len %u points to nonexistent indirect extent %llu",
p.k->p.inode, p.k->p.offset, p.k->size, idx);
+ bch2_inconsistent_error(c);
ret = -EIO;
goto err;
}
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c
index 9c46f67c0d8e..1e0effcece7f 100644
--- a/fs/bcachefs/io.c
+++ b/fs/bcachefs/io.c
@@ -1960,6 +1960,7 @@ int __bch2_read_indirect_extent(struct btree_trans *trans,
k.k->type != KEY_TYPE_indirect_inline_data) {
bch_err_inum_ratelimited(trans->c, orig_k->k->k.p.inode,
"pointer to nonexistent indirect extent");
+ bch2_inconsistent_error(trans->c);
ret = -EIO;
goto err;
}