summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-04-29 22:32:44 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2021-05-19 15:33:46 -0400
commite3b18c3685c23193ab47ed59b1f7b422db1b920f (patch)
tree7e7ced34e49f55d4efbf0401ad434db29f662330
parenta15ce03eb1a7b781ba3215045f2925565216cca0 (diff)
bcachefs: Call bch2_inconsistent_error() on missing stripe/indirect extent
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-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 c3ad0bc85e78..70008603f047 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -898,6 +898,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;
}
@@ -1015,6 +1016,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;
}
@@ -1499,6 +1501,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;
}
@@ -1739,6 +1742,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 36b10cb7ae62..d1a623991bbc 100644
--- a/fs/bcachefs/io.c
+++ b/fs/bcachefs/io.c
@@ -1968,6 +1968,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;
}