summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-04-29 22:32:44 -0400
committerStijn Tintel <stijn@linux-ipv6.be>2021-05-24 15:36:10 +0300
commitcbb7f8958dd101f9321c4276d2d59a8f6f2dc9fb (patch)
tree478229cb184dc2fb92d9e5309b30b1e42124843f
parent87f8d2143b450a2b43fbf15623c0c086fafa690a (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;
}