summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-03-01 18:33:14 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2018-03-01 18:33:14 -0500
commit2bb8cdfc75474cf11f9a9587ab9b15d009e48fc9 (patch)
treef05b854338ab5cc279800759045b0ce6a85f31f9
parent8a57b1f1d541d5fe9a0bfc665d6d3aeedd7ad355 (diff)
Update bcachefs sources to da224776eb bcachefs: fix an error path
-rw-r--r--.bcachefs_revision2
-rw-r--r--libbcachefs/btree_io.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/.bcachefs_revision b/.bcachefs_revision
index 7c24265..731adaa 100644
--- a/.bcachefs_revision
+++ b/.bcachefs_revision
@@ -1 +1 @@
-e7f4678827ad7bf7e294105e7bb3a53e04474070
+da224776eb43b7a47d8c7cd9314d5d1a8e97aabe
diff --git a/libbcachefs/btree_io.c b/libbcachefs/btree_io.c
index 881039b..0525c3b 100644
--- a/libbcachefs/btree_io.c
+++ b/libbcachefs/btree_io.c
@@ -947,7 +947,7 @@ enum btree_validate_ret {
#define btree_err(type, c, b, i, msg, ...) \
({ \
- char _buf[200], *out = _buf, *end = out + sizeof(_buf); \
+ char _buf[300], *out = _buf, *end = out + sizeof(_buf); \
\
out += btree_err_msg(c, b, i, b->written, write, out, end - out);\
out += scnprintf(out, end - out, ": " msg, ##__VA_ARGS__); \
@@ -1103,7 +1103,7 @@ static int validate_bset(struct bch_fs *c, struct btree *b,
bch2_bkey_val_to_text(c, type, buf, sizeof(buf), u);
btree_err(BTREE_ERR_FIXABLE, c, b, i,
- "invalid bkey %s: %s", buf, invalid);
+ "invalid bkey:\n%s\n%s", buf, invalid);
i->u64s = cpu_to_le16(le16_to_cpu(i->u64s) - k->u64s);
memmove_u64s_down(k, bkey_next(k),
@@ -1192,7 +1192,6 @@ int bch2_btree_node_read_done(struct bch_fs *c, struct btree *b, bool have_retry
sectors = vstruct_sectors(b->data, c->block_bits);
- set_btree_bset(b, b->set, &b->data->keys);
btree_node_set_format(b, b->data->format);
} else {
bne = write_block(b);
@@ -1258,6 +1257,8 @@ int bch2_btree_node_read_done(struct bch_fs *c, struct btree *b, bool have_retry
sorted = btree_bounce_alloc(c, btree_page_order(c), &used_mempool);
sorted->keys.u64s = 0;
+ set_btree_bset(b, b->set, &b->data->keys);
+
b->nr = btree_node_is_extents(b)
? bch2_extent_sort_fix_overlapping(c, &sorted->keys, b, iter)
: bch2_key_sort_fix_overlapping(&sorted->keys, b, iter);