diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-06 14:13:15 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-06 14:13:15 -0400 |
commit | 790ca9522a96efe321aae36fb0d7f4e437110b0f (patch) | |
tree | 06b208f7671ee218bcaa11876a7fb37f1806f3d7 /libbcachefs/btree_update_leaf.c | |
parent | 498874fdb71973c1856f35414bd607e58be16790 (diff) |
Update bcachefs sources to e027cf9aa0 fixup! bcachefs: Defer checking of alloc -> lru refs until after RW
Diffstat (limited to 'libbcachefs/btree_update_leaf.c')
-rw-r--r-- | libbcachefs/btree_update_leaf.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/libbcachefs/btree_update_leaf.c b/libbcachefs/btree_update_leaf.c index a0480c63..5427d0bd 100644 --- a/libbcachefs/btree_update_leaf.c +++ b/libbcachefs/btree_update_leaf.c @@ -856,23 +856,33 @@ static inline int do_bch2_trans_commit(struct btree_trans *trans, { struct bch_fs *c = trans->c; struct btree_insert_entry *i; + struct printbuf buf = PRINTBUF; int ret, u64s_delta = 0; trans_for_each_update(trans, i) { - const char *invalid = bch2_bkey_invalid(c, - bkey_i_to_s_c(i->k), i->bkey_type); - if (invalid) { - struct printbuf buf = PRINTBUF; + if (bch2_bkey_invalid(c, bkey_i_to_s_c(i->k), + i->bkey_type, WRITE, &buf)) { + printbuf_reset(&buf); + pr_buf(&buf, "invalid bkey on insert from %s -> %ps", + trans->fn, (void *) i->ip_allocated); + pr_newline(&buf); + pr_indent_push(&buf, 2); bch2_bkey_val_to_text(&buf, c, bkey_i_to_s_c(i->k)); - bch2_fs_fatal_error(c, "invalid bkey %s on insert from %s -> %ps: %s\n", - buf.buf, trans->fn, (void *) i->ip_allocated, invalid); + pr_newline(&buf); + + bch2_bkey_invalid(c, bkey_i_to_s_c(i->k), + i->bkey_type, WRITE, &buf); + + bch2_fs_fatal_error(c, "%s", buf.buf); printbuf_exit(&buf); return -EINVAL; } btree_insert_entry_checks(trans, i); } + printbuf_exit(&buf); + trans_for_each_update(trans, i) { if (i->cached) continue; @@ -1695,10 +1705,9 @@ retry: break; } - ret = bch2_trans_update(trans, &iter, &delete, 0) ?: + ret = bch2_trans_update(trans, &iter, &delete, update_flags) ?: bch2_trans_commit(trans, &disk_res, journal_seq, - BTREE_INSERT_NOFAIL| - update_flags); + BTREE_INSERT_NOFAIL); bch2_disk_reservation_put(trans->c, &disk_res); if (ret) break; |